import sand3d as s3d
def tray_stand():
base = s3d.at(tubular_frame(), x=42.5, y=-83, z=82)
tray = s3d.at(sliding_tray(), x=42.5, y=-16.5, z=507)
s3d.joint(&class="tok-comment">#39;joint_table_01_joint_00class="tok-string">39;, tray, s3d.local(base, x=0, y=66, z=889), kind=39;prismaticclass="tok-string">39;, axis=39;+Z39;, range=(0,229.2))
front = s3d.at(caster_front(), x=290.5, y=-403, z=7)
front_image = s3d.at(caster_front(tire_joint=&class="tok-comment">#39;joint_tire_02_joint_0039;), x=-205, y=-403, z=7)
rear = s3d.at(caster_rear(), x=269.5, y=257, z=7)
rear_image = s3d.at(caster_rear(tire_joint=&class="tok-comment">#39;joint_tire_04_joint_0039;), x=-184, y=257, z=7)
s3d.joint(&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;, front, s3d.local(base,x=248,y=-346,z=11),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_wheel_02_joint_00class="tok-string">39;, front_image, s3d.local(base,x=-247,y=-346,z=11),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_wheel_03_joint_00class="tok-string">39;, rear, s3d.local(base,x=227,y=314,z=11),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_wheel_04_joint_00class="tok-string">39;, rear_image, s3d.local(base,x=-227,y=314,z=11),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
handle = s3d.at(adjustment_handle(), x=43,y=275,z=782)
s3d.joint(&class="tok-comment">#39;joint_handle_01_joint_00class="tok-string">39;,handle,s3d.local(base,x=0,y=358,z=720),kind=39;continuousclass="tok-string">39;,axis=39;+Y39;)
return s3d.assembly(&class="tok-comment">#39;tray_stand39;,base,tray,front,front_image,rear,rear_image,handle)
def tubular_frame(w=495, d=669, tube=24, bend=60, rail_z=143, foot_h=0, upright_h=590, upright_y=323, rail_y=-11.5, rear_x=227):
rail = s3d.wire(&class="tok-comment">#39;base_tube39;,path=[(-w/2,rail_y-d/2,foot_h),(-w/2,rail_y-d/2,rail_z),(-w/2,rail_y+d/2,rail_z),(w/2,rail_y+d/2,rail_z),(w/2,rail_y-d/2,rail_z),(w/2,rail_y-d/2,foot_h)],d=tube,fillet=bend)
leg = s3d.at(s3d.cylinder(&class="tok-comment">#39;rear_leg39;,d=tube,h=rail_z),x=rear_x,y=314)
twin = s3d.transform(s3d.copy(leg),mirror=&class="tok-comment">#39;x39;)
s3d.join(rail,leg,twin)
post = s3d.at(s3d.cylinder(&class="tok-comment">#39;upright39;,d=tube,h=upright_h),y=upright_y,z=rail_z)
collar = s3d.at(s3d.cylinder(&class="tok-comment">#39;collar39;,d=31,h=31), y=upright_y,z=699)
boss = s3d.at(s3d.cylinder(&class="tok-comment">#39;clamp39;,d=18,h=30),y=upright_y,z=720,rx=-90)
s3d.join(post,collar,boss)
for ob in [rail,post]:
s3d.material(ob,&class="tok-comment">#39;chromeclass="tok-string">39;,color=39;#b4b8bb39;)
return s3d.group(&class="tok-comment">#39;tubular_frame39;,rail,post)
def sliding_tray(w=397,d=531,h=478,t=4,r=34,floor_z=439,stem_d=12):
pan = s3d.loft(&class="tok-comment">#39;tray39;,s3d.station(z=floor_z,w=w-40,d=d-40,n=12),s3d.station(z=h-t,w=w,d=d,n=12))
s3d.shell(pan,t=t,open=&class="tok-comment">#39;end39;)
rim = s3d.extrude(&class="tok-comment">#39;rim39;,s3d.rect(w=w,d=d,r=r),h=t)
s3d.pocket(rim,s3d.rect(w=w-2*t,d=d-2*t,r=r-t))
rim = s3d.at(rim,z=h-t)
stem = s3d.wire(&class="tok-comment">#39;sliding_stem39;,path=[(0,257,0),(0,257,floor_z-12),(0,-d/2,floor_z-12)],d=stem_d,fillet=18)
for ob in [pan,rim,stem]:
s3d.material(ob,&class="tok-comment">#39;brushed_steelclass="tok-string">39;,color=39;#bfc2c439;)
return s3d.group(&class="tok-comment">#39;sliding_tray39;,pan,rim,stem)
def caster_front(w=31,d=86,h=76,tire_joint=&class="tok-comment">#39;joint_tire_01_joint_0039;):
fork = caster_shell(w=w,d=d,h=h)
tire = s3d.at(tire_front(),y=-6.5,z=-7)
s3d.joint(tire_joint,tire,s3d.local(fork,x=0,y=-7,z=30),kind=&class="tok-comment">#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=86,h=76):
hub = s3d.at(s3d.cylinder(&class="tok-comment">#39;fork_disc39;,d=62,h=w),x=-w/2,y=-6.5,z=30,ry=90)
neck = s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel_neck39;,d=29,h=25),y=-26,z=h-25)
brake = s3d.at(s3d.box(&class="tok-comment">#39;brake39;,w=25,d=10,h=38),y=d/2-5,z=6)
s3d.fillet(brake,r=4)
s3d.join(hub,neck)
s3d.material(hub,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#858b9039;)
s3d.material(brake,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#565b6039;)
return s3d.group(&class="tok-comment">#39;fork39;,hub,brake)
def tire_front(w=49,d=73,h=73,t=12):
disk = s3d.cylinder(&class="tok-comment">#39;tire39;,d=d,h=t)
s3d.fillet(disk,r=3)
disk = s3d.at(disk,x=w/2-t,z=h/2,ry=90)
other = s3d.transform(s3d.copy(disk),mirror=&class="tok-comment">#39;x39;)
for ob in [disk,other]:
s3d.material(ob,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#45494c39;)
return s3d.group(&class="tok-comment">#39;tire_front39;,disk,other)
def caster_rear(w=31,d=86,h=76,tire_joint=&class="tok-comment">#39;joint_tire_03_joint_0039;):
fork = caster_shell(w=w,d=d,h=h)
tire = s3d.at(tire_rear(),y=-6.5,z=-7)
s3d.joint(tire_joint,tire,s3d.local(fork,x=0,y=-7,z=30),kind=&class="tok-comment">#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,h=73,t=12):
disk = s3d.cylinder(&class="tok-comment">#39;tire39;,d=d,h=t)
s3d.fillet(disk,r=3)
disk = s3d.at(disk,x=w/2-t,z=h/2,ry=90)
other = s3d.transform(s3d.copy(disk),mirror=&class="tok-comment">#39;x39;)
for ob in [disk,other]:
s3d.material(ob,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#45494c39;)
return s3d.group(&class="tok-comment">#39;tire_rear39;,disk,other)
def adjustment_handle(w=44,d=18,h=40):
knob=s3d.extrude(&class="tok-comment">#39;knob39;,s3d.rect(w=w,d=h,r=8),h=d)
knob=s3d.at(knob,y=d/2,z=h/2,rx=90)
s3d.material(knob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#393e4339;)
return s3d.group(&class="tok-comment">#39;adjustment_handle39;,knob)