import sand3d as s3d
def tray_cart():
root = s3d.at(body_01(), x=39.5, y=-1, z=119)
return s3d.assembly(&class="tok-comment">#39;tray_cart39;, root)
def body_01(w=588, d=937, tray_z=569, tray_h=98, t=8, leg_x=193.5, end_a=-395, end_b=441, rail_z=149, tube=26, rail_d=21, caster_a=266, caster_b=-333, handle_x=320.5, handle_top=953):
tray = s3d.at(s3d.shell(s3d.box(&class="tok-comment">#39;trayclass="tok-string">39;, w=w, d=d, h=tray_h), t=t, open=39;top39;), z=tray_z)
solids = [tray]
for x in (-leg_x, leg_x):
for y in (end_a, end_b):
solids.append(s3d.wire(&class="tok-comment">#39;leg39;, path=[(x,y,rail_z),(x,y,tray_z-19),(x+(handle_x-leg_x)*(1 if x>0 else -1),y,tray_z-19)], d=tube, fillet=tube))
solids.append(s3d.wire(&class="tok-comment">#39;lower_rail39;, path=[(x,end_a,rail_z),(x,end_b,rail_z)], d=rail_d))
for end, cy in ((end_a,caster_b),(end_b,caster_a)):
solids.append(s3d.wire(&class="tok-comment">#39;caster_leg39;, path=[(x,end,rail_z),(x,cy,40),(x,cy,0)], d=tube, fillet=tube))
solids.append(s3d.wire(&class="tok-comment">#39;brace39;, path=[(x,cy,40),(x,cy+(cy-end),rail_z)], d=18))
for y in (end_a,end_b):
solids.append(s3d.wire(&class="tok-comment">#39;cross_rail39;, path=[(-leg_x,y,rail_z),(leg_x,y,rail_z)], d=rail_d))
for x in (-handle_x,handle_x):
solids.append(s3d.wire(&class="tok-comment">#39;handle39;, path=[(x,end_a,tray_z-19),(x,end_a,719),(x,-250,handle_top)], d=30, fillet=60))
solids.append(s3d.wire(&class="tok-comment">#39;end_stub39;, path=[(x,end_b,tray_z-19),(x,end_b,tray_z+tray_h)], d=tube))
solids.append(s3d.at(s3d.cylinder(&class="tok-comment">#39;undertray39;, d=113, h=tray_z-384), z=384))
for ob in solids:
s3d.material(ob, &class="tok-comment">#39;brushed_steelclass="tok-string">39;, color=39;#a4a7a939;)
root = s3d.group(&class="tok-comment">#39;body_0139;, *solids)
a=s3d.at(wheel_01(), x=-leg_x, y=227, z=-tray_h)
s3d.joint(&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;, a, on=s3d.local(root,x=-193.5,y=266,z=-2),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
b=s3d.at(wheel_03(), x=-leg_x, y=-371.5, z=-tray_h)
s3d.joint(&class="tok-comment">#39;joint_wheel_03_joint_00class="tok-string">39;, b, on=s3d.local(root,x=-192.5,y=-333,z=-1),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
c=s3d.at(wheel_04(), x=leg_x, y=-371, z=-tray_h)
s3d.joint(&class="tok-comment">#39;joint_wheel_04_joint_00class="tok-string">39;, c, on=s3d.local(root,x=193.5,y=-332,z=-1),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
e=s3d.at(wheel_02(), x=leg_x, y=227, z=-tray_h)
s3d.joint(&class="tok-comment">#39;joint_wheel_02_joint_00class="tok-string">39;, e, on=s3d.local(root,x=193.5,y=266,z=-1),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
return s3d.group(&class="tok-comment">#39;body_01_group39;,root,a,b,c,e)
def wheel_01(w=44,d=128,h=100):
solid = caster_shell(w=w,d=d,h=h)
tire=s3d.at(tire_01(),y=10,z=-21)
s3d.joint(&class="tok-comment">#39;joint_tire_01_joint_00class="tok-string">39;,tire,on=s3d.local(solid,x=0,y=10,z=31),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;wheel_0139;,solid,tire)
def caster_shell(w=44,d=128,h=100,th=4,r=57,axle=31,offset=10):
cover=s3d.at(s3d.tube(&class="tok-comment">#39;cover39;,d=r*2,d_in=(r-th)*2,h=w),x=-w/2,y=offset,z=axle,ry=90)
cover=s3d.intersect(cover,s3d.box(&class="tok-comment">#39;clip39;,w=w+th,d=d*2,h=h))
tool=s3d.at(s3d.box(&class="tok-comment">#39;lower_rear39;,w=w+th,d=d,h=axle),y=offset-d/2)
cover=s3d.cut(cover,tool)
stem=s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel39;,d=w,h=h-60),y=39,z=60)
arm=s3d.at(s3d.box(&class="tok-comment">#39;brake_arm39;,w=w-th*2,d=45,h=th*2),y=-25,z=15)
profile=s3d.stroke(s3d.spline([(-47,70),(-51,45),(-48,20),(-60,0)]),t=th*2)
brake=s3d.at(s3d.extrude(&class="tok-comment">#39;brake39;,profile,h=w),x=-w/2,rx=90,rz=90)
ob=s3d.join(cover,stem,arm,brake)
s3d.material(ob,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#777b7f39;)
return ob
def tire_01(w=70,d=105,r=4,disc=18,hub=54):
a=s3d.cylinder(&class="tok-comment">#39;disc39;,d=d,h=disc)
a=s3d.fillet(a,r=r)
b=s3d.at(s3d.copy(a),z=w-disc)
core=s3d.cylinder(&class="tok-comment">#39;hub39;,d=hub,h=w)
ob=s3d.at(s3d.join(core,a,b),x=-w/2,z=d/2,ry=90)
s3d.material(ob,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44484b39;)
return s3d.group(&class="tok-comment">#39;tire_0139;,ob)
def wheel_03(w=44,d=128,h=100):
solid=caster_shell(w=w,d=d,h=h)
tire=s3d.at(tire_03(),y=10,z=-21)
s3d.joint(&class="tok-comment">#39;joint_tire_03_joint_00class="tok-string">39;,tire,on=s3d.local(solid,x=0,y=10.5,z=31),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;wheel_0339;,solid,tire)
def tire_03(w=70,d=105,r=4,disc=18,hub=54):
a=s3d.fillet(s3d.cylinder(&class="tok-comment">#39;disc39;,d=d,h=disc),r=r)
b=s3d.at(s3d.copy(a),z=w-disc)
core=s3d.cylinder(&class="tok-comment">#39;hub39;,d=hub,h=w)
ob=s3d.at(s3d.join(core,a,b),x=-w/2,z=d/2,ry=90)
s3d.material(ob,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44484b39;)
return s3d.group(&class="tok-comment">#39;tire_0339;,ob)
def wheel_04(w=44,d=128,h=100):
solid=caster_shell(w=w,d=d,h=h)
tire=s3d.at(tire_04(),y=9,z=-21)
s3d.joint(&class="tok-comment">#39;joint_tire_04_joint_00class="tok-string">39;,tire,on=s3d.local(solid,x=0,y=9,z=31),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;wheel_0439;,solid,tire)
def tire_04(w=70,d=105,r=4,disc=18,hub=54):
a=s3d.fillet(s3d.cylinder(&class="tok-comment">#39;disc39;,d=d,h=disc),r=r)
b=s3d.at(s3d.copy(a),z=w-disc)
core=s3d.cylinder(&class="tok-comment">#39;hub39;,d=hub,h=w)
ob=s3d.at(s3d.join(core,a,b),x=-w/2,z=d/2,ry=90)
s3d.material(ob,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44484b39;)
return s3d.group(&class="tok-comment">#39;tire_0439;,ob)
def wheel_02(w=44,d=128,h=100):
solid=caster_shell(w=w,d=d,h=h)
tire=s3d.at(tire_02(),y=10,z=-21)
s3d.joint(&class="tok-comment">#39;joint_tire_02_joint_00class="tok-string">39;,tire,on=s3d.local(solid,x=0,y=10,z=31),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;wheel_0239;,solid,tire)
def tire_02(w=70,d=105,r=4,disc=18,hub=54):
a=s3d.fillet(s3d.cylinder(&class="tok-comment">#39;disc39;,d=d,h=disc),r=r)
b=s3d.at(s3d.copy(a),z=w-disc)
core=s3d.cylinder(&class="tok-comment">#39;hub39;,d=hub,h=w)
ob=s3d.at(s3d.join(core,a,b),x=-w/2,z=d/2,ry=90)
s3d.material(ob,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44484b39;)
return s3d.group(&class="tok-comment">#39;tire_0239;,ob)