import sand3d as s3d
def rolling_tray():
root = s3d.at(pedestal(), x=3, y=-40.5, z=31)
return s3d.assembly(&class="tok-comment">#39;rolling_tray39;, root)
def pedestal(post_d=90, post_h=751, plate_t=18, plate_z=53, rod_d=8, post_y=36.5, arm_x=194.5, caster_z=-24, rod_x=63, rod_y=175, rod_z=227):
post = s3d.at(s3d.cylinder(&class="tok-comment">#39;post39;, d=post_d, h=post_h), y=post_y, z=plate_z)
outline = s3d.mirror(s3d.poly([(0,-287),(48,-250),(62,60),(213,155),(185,210),(0,158)], fillet=20))
base = s3d.at(s3d.extrude(&class="tok-comment">#39;base39;, outline, h=plate_t), y=post_y, z=plate_z)
lock = s3d.box(&class="tok-comment">#39;lock39;, w=100, d=120, h=plate_z)
rod = s3d.wire(&class="tok-comment">#39;lever39;, s3d.spline([(-rod_x,0,62),(-rod_x,-rod_y,rod_z),(0,-211,258),(rod_x,-rod_y,rod_z),(rod_x,0,62)]), d=rod_d)
boss = s3d.at(s3d.cylinder(&class="tok-comment">#39;locking_boss39;, d=post_d/2, h=post_d/2), y=post_y, z=post_h+plate_z-25, rx=-90)
fixed = s3d.group(&class="tok-comment">#39;fixed39;, post, base, lock, rod, boss)
s3d.material(fixed, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#a9acac39;)
handle = s3d.at(adjustment_handle(), x=0, y=post_y+80, z=759)
s3d.joint(&class="tok-comment">#39;joint_handle_01_joint_00class="tok-string">39;, handle, s3d.local(fixed, 0,114,779), kind=39;continuousclass="tok-string">39;, axis=39;+Y39;)
front = s3d.at(caster_front(), x=arm_x, y=240, z=caster_z)
s3d.joint(&class="tok-comment">#39;joint_wheel_03_joint_00class="tok-string">39;, front, s3d.local(fixed,195,214.5,62), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
rear = s3d.at(caster_rear(), x=-3.5, y=-253.5, z=caster_z)
s3d.joint(&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;, rear, s3d.local(fixed,-3,-227.5,62), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
outer = s3d.at(caster_outer(), x=-arm_x, y=240, z=caster_z)
s3d.joint(&class="tok-comment">#39;joint_wheel_02_joint_00class="tok-string">39;, outer, s3d.local(fixed,-194,214.5,62), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
top = s3d.at(tray(), x=0, y=post_y, z=332)
s3d.joint(&class="tok-comment">#39;joint_table_01_joint_00class="tok-string">39;, top, s3d.local(fixed,0,36.5,890), kind=39;prismaticclass="tok-string">39;, axis=39;+Z39;, range=(0,378.7))
return s3d.group(&class="tok-comment">#39;pedestal39;, fixed, handle, front, rear, outer, top)
def adjustment_handle(d=38, length=44):
knob = s3d.at(s3d.cylinder(&class="tok-comment">#39;knob39;, d=d, h=length), y=-length/2, z=d/2, rx=-90)
s3d.material(knob, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#50545539;)
return s3d.group(&class="tok-comment">#39;adjustment_handle39;, knob)
def caster_front(w=31, d=87, h=88):
fork = caster_shell(w=w, d=d, h=h)
tire = s3d.at(tire_front(), y=-7, z=-7)
s3d.joint(&class="tok-comment">#39;joint_tire_03_joint_00class="tok-string">39;, tire, s3d.local(fork,0,-6.5,29), kind=39;continuousclass="tok-string">39;, axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;caster_front39;, fork, tire)
def caster_shell(w=31, d=87, h=88, wall=4, disk_d=65):
arch = s3d.at(s3d.tube(&class="tok-comment">#39;fork_arch39;, d=83, d_in=75, h=w), x=-w/2, y=-7, z=29, ry=90)
arch = s3d.cut(arch, s3d.at(s3d.box(&class="tok-comment">#39;trim39;, w=w*2, d=d*2, h=h), z=29-h))
stem = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel39;, d=30, h=30), y=-25.5, z=h-30)
brake = s3d.at(s3d.box(&class="tok-comment">#39;brake39;, w=w, d=wall, h=36), y=d/2-wall, z=8, rx=15)
plate = s3d.cylinder(&class="tok-comment">#39;side_plate39;, d=disk_d, h=wall)
plate = s3d.hole(plate, d=12)
plate = s3d.at(plate, x=-w/2, y=-7, z=29, ry=90)
twin = s3d.transform(s3d.copy(plate), x=w-wall)
fork = s3d.group(&class="tok-comment">#39;fork39;, arch, stem, brake, plate, twin)
s3d.material(fork, &class="tok-comment">#39;steelclass="tok-string">39;, color=39;#93999c39;)
return fork
def tire_front(w=49, d=73):
solid = twin_tire(w=w, d=d)
return s3d.group(&class="tok-comment">#39;tire_front39;, solid)
def twin_tire(w=49, d=73, t=12):
disk = s3d.cylinder(&class="tok-comment">#39;tire39;, d=d, h=t)
s3d.fillet(disk, r=2)
disk = s3d.at(disk, x=-w/2, z=d/2, ry=90)
other = s3d.transform(s3d.copy(disk), x=w-t)
solid = s3d.group(&class="tok-comment">#39;wheels39;, disk, other)
s3d.material(solid, &class="tok-comment">#39;rubberclass="tok-string">39;, color=39;#55595b39;)
return solid
def caster_rear(w=31, d=86, h=88):
shell = s3d.transform(caster_shell(w=w, d=d, h=h), mirror=&class="tok-comment">#39;y39;)
fork = s3d.group(&class="tok-comment">#39;rear_fork39;, shell)
tire = s3d.at(tire_rear(), y=6.5, z=-7)
s3d.joint(&class="tok-comment">#39;joint_tire_01_joint_00class="tok-string">39;, tire, s3d.local(fork,0,7,29), kind=39;continuousclass="tok-string">39;, axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;caster_rear39;, fork, tire)
def tire_rear(w=49, d=73):
solid = twin_tire(w=w, d=d)
return s3d.group(&class="tok-comment">#39;tire_rear39;, solid)
def caster_outer(w=31, d=87, h=88):
fork = caster_shell(w=w, d=d, h=h)
tire = s3d.at(tire_outer(), y=-7, z=-7)
s3d.joint(&class="tok-comment">#39;joint_tire_02_joint_00class="tok-string">39;, tire, s3d.local(fork,0,-6.5,29), kind=39;continuousclass="tok-string">39;, axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;caster_outer39;, fork, tire)
def tire_outer(w=49, d=73):
solid = twin_tire(w=w, d=d)
return s3d.group(&class="tok-comment">#39;tire_outer39;, solid)
def tray(w=506, d=706, h=581, rim_h=34, wall=5, corner=22, floor_z=557, floor_t=5):
rim = s3d.extrude(&class="tok-comment">#39;tray_rim39;, s3d.rect(w=w, d=d, r=corner), h=rim_h)
rim = s3d.cut(rim, s3d.extrude(&class="tok-comment">#39;inside39;, s3d.rect(w=w-2*wall, d=d-2*wall, r=corner-wall), h=rim_h*2))
rim = s3d.at(rim, z=h-rim_h)
floor = s3d.at(s3d.extrude(&class="tok-comment">#39;tray_floor39;, s3d.rect(w=w-wall, d=d-wall, r=corner), h=floor_t), z=floor_z)
support = s3d.box(&class="tok-comment">#39;slider39;, w=45, d=64, h=floor_z+floor_t)
top = s3d.group(&class="tok-comment">#39;tray39;, rim, floor, support)
s3d.material(top, &class="tok-comment">#39;brushed_steelclass="tok-string">39;, color=39;#b9bdbf39;)
return top