import sand3d as s3d
def tray_stand():
root = s3d.at(stand(), x=-46.5, y=48.5, z=90)
outer = s3d.at(caster_mount_outer(), x=207.5, y=-257, z=16)
s3d.joint(&class="tok-comment">#39;joint_wheel_02_joint_00class="tok-string">39;, outer, s3d.local(root, x=254, y=-332, z=6), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
stem = s3d.at(caster_mount_stem(), x=-46.5, y=358, z=16)
s3d.joint(&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;, stem, s3d.local(root, x=0, y=337, z=-8), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
cross = s3d.at(caster_mount_cross(), x=-302.5, y=-257, z=16)
s3d.joint(&class="tok-comment">#39;joint_wheel_03_joint_00class="tok-string">39;, cross, s3d.local(root, x=-255, y=-333, z=-8), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
return s3d.assembly(&class="tok-comment">#39;tray_stand39;, root, outer, stem, cross)
def stand(foot_w=63, foot_l=369, foot_h=38, hub_y=-160.5, arm_x=127, arm_y=-85.5, arm_angle=-34, stem_l=558, stem_y=87, post_d=57, post_h=710, tray_w=390, tray_d=628, tray_y=51.5, tray_z=759, tray_t=6, rim_h=8, rim_t=8, corner=70, handle_d=704, handle_y=13.5, gap_w=240, gap_d=56, gap_y=-289.5, cap_x=136, cap_y=-281.5, cap_d=68, cap_h=76):
arm = s3d.at(s3d.extrude(&class="tok-comment">#39;spreading_foot39;, s3d.slot(l=foot_l, d=foot_w), h=foot_h), x=arm_x, y=hub_y+arm_y, rz=arm_angle)
twin = s3d.transform(s3d.copy(arm), mirror=&class="tok-comment">#39;x39;)
long = s3d.at(s3d.extrude(&class="tok-comment">#39;long_foot39;, s3d.slot(l=stem_l, d=foot_w), h=foot_h), y=stem_y, rz=90)
base = s3d.join(arm, twin, long)
post = s3d.at(s3d.cylinder(&class="tok-comment">#39;post39;, d=post_d, h=post_h), y=hub_y, z=foot_h/2)
collar = s3d.at(s3d.cone(&class="tok-comment">#39;post_collar39;, d=post_d+rim_t*4, d2=post_d, h=foot_h), y=hub_y, z=foot_h/2)
tray = s3d.at(s3d.extrude(&class="tok-comment">#39;tray39;, s3d.rect(w=tray_w, d=handle_d, r=corner), h=tray_t+rim_h/2), y=handle_y, z=tray_z)
tray = s3d.pocket(tray, s3d.rect(w=gap_w, d=gap_d, r=rim_t), on=tray.face(&class="tok-comment">#39;top39;).move(y=gap_y-handle_y))
inset = s3d.at(s3d.extrude(&class="tok-comment">#39;rim39;, s3d.rect(w=tray_w, d=tray_d, r=corner), h=rim_h), y=tray_y, z=tray_z+tray_t)
inset = s3d.pocket(inset, s3d.rect(w=tray_w-rim_t*2, d=tray_d-rim_t*2, r=corner-rim_t), depth=rim_h)
cap = s3d.at(s3d.cylinder(&class="tok-comment">#39;handle_post39;, d=cap_d, h=cap_h), x=cap_x, y=cap_y, z=tray_z-cap_h/2)
lid = s3d.at(s3d.cylinder(&class="tok-comment">#39;cap39;, d=cap_d+rim_t/4, h=rim_t), x=cap_x, y=cap_y, z=tray_z+cap_h/2-rim_t)
cap = s3d.join(cap, lid)
cap_twin = s3d.transform(s3d.copy(cap), mirror=&class="tok-comment">#39;x39;)
for solid in (base, post, collar, tray, inset, cap, cap_twin):
s3d.material(solid, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#b8babc39;)
return s3d.group(&class="tok-comment">#39;stand39;, base, post, collar, tray, inset, cap, cap_twin)
def caster_mount_outer(w=31, d=88, h=93):
solid = fork(w=w, d=d, h=h)
tire = s3d.at(tire_outer(), y=-7.5, z=-16)
part = s3d.group(&class="tok-comment">#39;caster_mount_outer39;, solid, tire)
s3d.joint(&class="tok-comment">#39;joint_tire_02_joint_00class="tok-string">39;, tire, s3d.local(part, x=-26, y=-7, z=21), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
return part
def fork(w, d, h):
profile = s3d.poly([s3d.arc(center=(0,0), r=d/2, start=0, end=180), (-d/2+3,0), s3d.arc(center=(0,0), r=d/2-3, start=180, end=0)])
arch = s3d.at(s3d.extrude(&class="tok-comment">#39;fork_arch39;, profile, h=w), x=-w/2, z=21, rx=90, rz=90)
skirt = s3d.at(s3d.box(&class="tok-comment">#39;fork_skirt39;, w=w, d=3, h=24), y=-d/2+1.5)
stem = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel39;, d=w/3, h=h/3), y=-d/3, z=h*2/3)
boss = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel_boss39;, d=w, h=h/3), y=-d/3, z=h/3)
flange = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel_flange39;, d=w*1.2, h=6), y=-d/3, z=h*2/3-6)
pedal = s3d.at(s3d.box(&class="tok-comment">#39;brake_pedal39;, w=w, d=4, h=50), y=d/2-3, rx=20)
bridge = s3d.at(s3d.box(&class="tok-comment">#39;brake_link39;, w=w/2, d=d/3, h=4), y=d/3, z=21)
solid = s3d.join(arch, skirt, stem, boss, flange, pedal, bridge)
s3d.material(solid, kind=&class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#999da039;)
return solid
def tire_outer(w=49, d=73):
return s3d.group(&class="tok-comment">#39;tire_outer39;, wheel(w=w, d=d))
def wheel(w, d):
solid = s3d.cylinder(&class="tok-comment">#39;wheel39;, d=d, h=w)
solid = s3d.fillet(solid, r=w/8)
solid = s3d.at(solid, x=-w/2, z=d/2, ry=90)
s3d.material(solid, kind=&class="tok-comment">#39;rubberclass="tok-string">39;, color=39;#44484a39;)
return solid
def caster_mount_stem(w=31, d=88, h=93):
solid = s3d.transform(fork(w=w, d=d, h=h), mirror=&class="tok-comment">#39;y39;)
tire = s3d.at(tire_stem(), x=-1, y=7.5, z=-16)
s3d.joint(&class="tok-comment">#39;joint_tire_01_joint_00class="tok-string">39;, tire, s3d.local(solid, x=-1, y=7, z=21), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
return s3d.group(&class="tok-comment">#39;caster_mount_stem39;, solid, tire)
def tire_stem(w=49, d=73):
return s3d.group(&class="tok-comment">#39;tire_stem39;, wheel(w=w, d=d))
def caster_mount_cross(w=31, d=88, h=93):
solid = fork(w=w, d=d, h=h)
tire = s3d.at(tire_cross(), x=1, y=-7.5, z=-16)
s3d.joint(&class="tok-comment">#39;joint_tire_03_joint_00class="tok-string">39;, tire, s3d.local(solid, x=1, y=-7, z=21), kind=39;continuousclass="tok-string">39;, axis=39;+X39;)
return s3d.group(&class="tok-comment">#39;caster_mount_cross39;, solid, tire)
def tire_cross(w=49, d=73):
return s3d.group(&class="tok-comment">#39;tire_cross39;, wheel(w=w, d=d))