Skip to content

Commit

Permalink
Changed the render camera placing heuristic to take into account the …
Browse files Browse the repository at this point in the history
…image is wider than it is tall.

Updated all the images.
  • Loading branch information
nophead committed Mar 24, 2012
1 parent b40f707 commit 750ea16
Show file tree
Hide file tree
Showing 109 changed files with 6 additions and 10 deletions.
Binary file modified mendel/render/cable_clip_AB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/cable_clip_AD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/cable_clip_CA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/d_motor_bracket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/d_motor_bracket_lid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/d_shell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/d_shell_lid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/fan_guard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/fixing_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/pcb_spacer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/bar_clamps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/cable_clips.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/cal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/d_motor_brackets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/ribbon_clamps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/wades_extruder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/x_carriage_parts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/y_bearing_mounts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/y_belt_anchors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/printed/z_motor_brackets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/pulley.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/ribbon_clamp_12_33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/ribbon_clamp_20_33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/ribbon_clamp_20_44.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/ribbon_clamp_22_33.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified mendel/render/ribbon_clamp_22_44.png
Binary file modified mendel/render/wades_big_gear.png
Binary file modified mendel/render/wades_block.png
Binary file modified mendel/render/wades_gear_spacer.png
Binary file modified mendel/render/wades_idler_block.png
Binary file modified mendel/render/wades_small_gear.png
Binary file modified mendel/render/x_belt_clamp.png
Binary file modified mendel/render/x_belt_grip.png
Binary file modified mendel/render/x_belt_tensioner.png
Binary file modified mendel/render/x_carriage.png
Binary file modified mendel/render/x_idler_bracket.png
Binary file modified mendel/render/x_motor_bracket.png
Binary file modified mendel/render/y_bar_clamp.png
Binary file modified mendel/render/y_bar_clamp_switch.png
Binary file modified mendel/render/y_bearing_mount.png
Binary file modified mendel/render/y_bearing_mount_switch.png
Binary file modified mendel/render/y_belt_anchor.png
Binary file modified mendel/render/y_belt_anchor_toothed.png
Binary file modified mendel/render/y_belt_clip.png
Binary file modified mendel/render/y_belt_clip_toothed.png
Binary file modified mendel/render/y_idler_bracket.png
Binary file modified mendel/render/y_motor_bracket.png
Binary file modified mendel/render/z_bar_clamp.png
Binary file modified mendel/render/z_bar_clamp_switch.png
Binary file modified mendel/render/z_coupling.png
Binary file modified mendel/render/z_limit_switch_bracket.png
Binary file modified mendel/render/z_motor_bracket_lhs.png
Binary file modified mendel/render/z_motor_bracket_rhs.png
Binary file modified mendel/render/z_screw_pointer.png
Binary file modified sturdy/render/cable_clip_AB.png
Binary file modified sturdy/render/cable_clip_AD.png
Binary file modified sturdy/render/cable_clip_CA.png
Binary file modified sturdy/render/d_motor_bracket.png
Binary file modified sturdy/render/d_motor_bracket_lid.png
Binary file modified sturdy/render/d_shell.png
Binary file modified sturdy/render/d_shell_lid.png
Binary file modified sturdy/render/fan_guard.png
Binary file modified sturdy/render/fixing_block.png
Binary file modified sturdy/render/pcb_spacer.png
Binary file modified sturdy/render/printed/bar_clamps.png
Binary file modified sturdy/render/printed/cable_clips.png
Binary file modified sturdy/render/printed/cal.png
Binary file modified sturdy/render/printed/d_motor_brackets.png
Binary file modified sturdy/render/printed/ribbon_clamps.png
Binary file modified sturdy/render/printed/wades_extruder.png
Binary file modified sturdy/render/printed/x_carriage_parts.png
Binary file modified sturdy/render/printed/y_bearing_mounts.png
Binary file modified sturdy/render/printed/y_belt_anchors.png
Binary file modified sturdy/render/printed/z_motor_brackets.png
Binary file modified sturdy/render/pulley.png
Binary file modified sturdy/render/ribbon_clamp_12_33.png
Binary file modified sturdy/render/ribbon_clamp_20_33.png
Binary file modified sturdy/render/ribbon_clamp_20_40.png
Binary file modified sturdy/render/ribbon_clamp_22_40.png
Binary file modified sturdy/render/ribbon_clamp_22_44.png
Binary file modified sturdy/render/wades_big_gear.png
Binary file modified sturdy/render/wades_block.png
Binary file modified sturdy/render/wades_gear_spacer.png
Binary file modified sturdy/render/wades_idler_block.png
Binary file modified sturdy/render/wades_small_gear.png
Binary file modified sturdy/render/x_belt_clamp.png
Binary file modified sturdy/render/x_belt_grip.png
Binary file modified sturdy/render/x_belt_tensioner.png
Binary file modified sturdy/render/x_carriage.png
Binary file modified sturdy/render/x_idler_bracket.png
Binary file modified sturdy/render/x_motor_bracket.png
Binary file modified sturdy/render/y_bar_clamp.png
Binary file modified sturdy/render/y_bar_clamp_switch.png
Binary file modified sturdy/render/y_bearing_mount.png
Binary file modified sturdy/render/y_bearing_mount_switch.png
Binary file modified sturdy/render/y_belt_anchor.png
Binary file modified sturdy/render/y_belt_anchor_toothed.png
Binary file modified sturdy/render/y_belt_clip.png
Binary file modified sturdy/render/y_belt_clip_toothed.png
Binary file modified sturdy/render/y_idler_bracket.png
Binary file modified sturdy/render/y_motor_bracket.png
Binary file modified sturdy/render/z_bar_clamp.png
Binary file modified sturdy/render/z_bar_clamp_switch.png
Binary file modified sturdy/render/z_coupling.png
Binary file modified sturdy/render/z_limit_switch_bracket.png
Binary file modified sturdy/render/z_motor_bracket_lhs.png
Binary file modified sturdy/render/z_motor_bracket_rhs.png
Binary file modified sturdy/render/z_screw_pointer.png
16 changes: 6 additions & 10 deletions utils/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def load_stl(file_path):
ob = bpy.context.selected_objects[0]
print(ob)
bpy.ops.object.select_all(action='DESELECT')
ob.select = True
ob.select = True
# remove doubles and clean
#py.ops.object.editmode_toggle()
#bpy.ops.mesh.select_all(action='TOGGLE')
Expand All @@ -26,20 +26,16 @@ def load_stl(file_path):
print(z_dim)
bpy.ops.transform.translate(value=(0,0,z_dim/2.0))
cam_target = (0,0,z_dim/3.0)
# assign material
# assign material
ob.material_slots.data.active_material = bpy.data.materials[mat]

def place_camera():
global cam_target
max_dim = 0
for i in ob.dimensions:
print(i)
if i > max_dim:
max_dim = i
max_dim = max(ob.dimensions[0] * 0.75, ob.dimensions[1] * 0.75, ob.dimensions[2])
print(max_dim)
bpy.data.objects['target'].location = cam_target
cam = bpy.data.objects['Camera'].location.x = max_dim*2.4
cam = bpy.data.objects['Camera'].location.x = max_dim * 2.4

def render_thumb(image,gl=False,anim=False):
if gl:
if anim:
Expand Down

0 comments on commit 750ea16

Please sign in to comment.