import sand3d as s3d
def instrument_stand():
base = s3d.at(pedestal(), x=-23, y=46, z=44)
top = s3d.at(tray(), x=-23, y=71, z=140)
s3d.joint(&class="tok-comment">#39;joint_tray_01_joint_00class="tok-string">39;, top, s3d.local(base, x=0, y=-159, z=96), kind=39;prismaticclass="tok-string">39;, axis=39;+Z39;, range=(0,439.8))
a = s3d.at(compact_caster_fork(), x=177, y=-322.5, z=29)
b = s3d.transform(s3d.copy(s3d.at(compact_caster_fork(wheel_joint=&class="tok-comment">#39;joint_wheel_04_joint_00class="tok-string">39;), x=177, y=-322.5, z=29)), mirror=39;x39;, x=-46)
c = s3d.at(extended_caster_fork(), x=228, y=432.5, z=29)
e = s3d.transform(s3d.copy(s3d.at(extended_caster_fork(wheel_joint=&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;), x=228, y=432.5, z=29)), mirror=39;x39;, x=-46)
pin = s3d.at(locking_pin(), x=-23, y=-161.5, z=594)
s3d.joint(&class="tok-comment">#39;joint_supportWheel_03_joint_00class="tok-string">39;, a, s3d.local(base,x=200,y=-381,z=43),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_supportWheel_04_joint_00class="tok-string">39;, b, s3d.local(base,x=-200,y=-381,z=43),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_supportWheel_02_joint_00class="tok-string">39;, c, s3d.local(base,x=251,y=374,z=41),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_supportWheel_01_joint_00class="tok-string">39;, e, s3d.local(base,x=-250,y=374,z=41),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_lockingPin_01_joint_00class="tok-string">39;,pin,s3d.local(base,x=0,y=-215,z=557),kind=39;continuousclass="tok-string">39;,axis=39;+Y39;)
return s3d.assembly(&class="tok-comment">#39;instrument_stand39;,base,top,a,b,c,e,pin)
def pedestal(post_d=52, post_h=502, neck_d=45, neck_h=134, tube_d=25, base_t=3, rear_w=510, ridge_w=350, end_w=400, front_y=-396, fold_y=-276, rear_y=-107, mount_y=-159, foot_z=48, ridge_z=108):
post=s3d.at(s3d.cylinder(&class="tok-comment">#39;upright39;,d=post_d,h=post_h),y=mount_y,z=foot_z)
neck=s3d.at(s3d.cylinder(&class="tok-comment">#39;neck39;,d=neck_d,h=neck_h),y=mount_y,z=post_h)
front=s3d.loft(&class="tok-comment">#39;front_fold39;,s3d.station(z=front_y,w=end_w,d=base_t,y=-foot_z,n=4),s3d.station(z=fold_y,w=ridge_w,d=base_t,y=-ridge_z,n=4))
back=s3d.loft(&class="tok-comment">#39;rear_fold39;,s3d.station(z=fold_y,w=ridge_w,d=base_t,y=-ridge_z,n=4),s3d.station(z=rear_y,w=rear_w,d=base_t,y=-foot_z,n=4))
front=s3d.at(front,rx=-90)
back=s3d.at(back,rx=-90)
recess=s3d.at(s3d.box(&class="tok-comment">#39;recess39;,w=130,d=130,h=ridge_z*2),y=mount_y)
back=s3d.cut(back,recess)
rail=s3d.wire(&class="tok-comment">#39;outrigger39;,path=[(200,-381,43),(200,-225,43),(218,-151,43),(252,-69,18),(252,334,18),(252,374,37)],d=tube_d,fillet=45)
other=s3d.transform(s3d.copy(rail),mirror=&class="tok-comment">#39;x39;)
mount=s3d.at(s3d.box(&class="tok-comment">#39;post_mount39;,w=130,d=130,h=base_t),y=mount_y,z=foot_z)
ob=s3d.group(&class="tok-comment">#39;pedestal39;,post,neck,front,back,rail,other,mount)
s3d.material(ob,kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#888d9039;)
return ob
def tray(w=524,d=798,h=612,t=3,rim_h=28,end_w=380,straight=158,bar_y=250,bar_w=16,inner_d=42,inner_h=575):
outline=s3d.poly([(-end_w/2,-d/2),(end_w/2,-d/2),(w/2,-straight/2),(w/2,straight/2),(end_w/2,d/2),(-end_w/2,d/2),(-w/2,straight/2),(-w/2,-straight/2)])
plate=s3d.at(s3d.extrude(&class="tok-comment">#39;tray_sheet39;,outline,h=t),z=h-rim_h-t)
for x,diam in [(-150,25),(-105,25),(-39,34),(39,32),(105,25),(150,25)]:
s3d.hole(plate,d=diam,on=(x,d/2-57))
rim=s3d.extrude(&class="tok-comment">#39;rim39;,outline,h=rim_h)
rim=s3d.pocket(rim,s3d.offset(outline,t=-t),depth=rim_h,on=rim.face(&class="tok-comment">#39;top39;))
rim=s3d.at(rim,z=h-rim_h)
bars=s3d.at(s3d.box(&class="tok-comment">#39;crossbar39;,w=443,d=bar_w,h=rim_h),on=s3d.grid(nx=1,ny=2,py=bar_y*2),z=h-rim_h-t)
bays=s3d.at(s3d.box(&class="tok-comment">#39;bay_divider39;,w=t,d=132,h=12),on=s3d.grid(nx=2,px=130).move(y=-d/2+66),z=h-rim_h)
spine=s3d.at(s3d.box(&class="tok-comment">#39;under_spine39;,w=32,d=d-10,h=32),z=h-rim_h-32)
cross=s3d.at(s3d.box(&class="tok-comment">#39;under_cross39;,w=w,d=30,h=32),z=h-rim_h-32)
shaft=s3d.at(s3d.cylinder(&class="tok-comment">#39;sliding_shaft39;,d=inner_d,h=inner_h),y=-184)
flange=s3d.at(s3d.box(&class="tok-comment">#39;tray_flange39;,w=130,d=130,h=t),y=-184,z=inner_h)
ob=s3d.group(&class="tok-comment">#39;tray39;,plate,rim,bars,bays,spine,cross,shaft,flange)
s3d.material(ob,kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#959a9d39;)
return ob
def compact_caster_fork(w=37,d=63,h=58,t=4,wheel_joint=&class="tok-comment">#39;joint_wheel_03_joint_0039;):
crown=s3d.at(s3d.extrude(&class="tok-comment">#39;crown39;,s3d.rect(w,d,r=6),h=t),z=h-t)
side=s3d.at(s3d.extrude(&class="tok-comment">#39;fork_cheek39;,s3d.poly([(-d/2,h-t),(d/2,h-t),(d/2,12),(20,0),(8,0),(-d/2,35)]),h=t),rx=90,rz=90,x=-w/2)
twin=s3d.transform(s3d.copy(side),mirror=&class="tok-comment">#39;x39;)
solid=s3d.group(&class="tok-comment">#39;fork_metal39;,crown,side,twin)
s3d.material(solid,kind=&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#8d929539;)
wheel=s3d.at(compact_caster_wheel(),y=20,z=-29)
s3d.joint(wheel_joint,wheel,s3d.local(solid,x=0,y=20,z=10),kind=&class="tok-comment">#39;continuousclass="tok-string">39;,axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;compact_caster_fork39;,solid,wheel)
def compact_caster_wheel(w=25,d=77):
tire=s3d.at(s3d.cylinder(&class="tok-comment">#39;tire39;,d=d,h=w),ry=90,x=-w/2,z=d/2)
s3d.fillet(tire,r=4)
s3d.material(tire,kind=&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44484a39;)
return s3d.group(&class="tok-comment">#39;compact_caster_wheel39;,tire)
def extended_caster_fork(w=36,d=63,h=56,t=4,wheel_joint=&class="tok-comment">#39;joint_wheel_02_joint_0039;):
crown=s3d.at(s3d.extrude(&class="tok-comment">#39;crown39;,s3d.rect(w,d,r=6),h=t),z=h-t)
side=s3d.at(s3d.extrude(&class="tok-comment">#39;fork_cheek39;,s3d.poly([(-d/2,h-t),(d/2,h-t),(d/2,12),(20,0),(8,0),(-d/2,35)]),h=t),rx=90,rz=90,x=-w/2)
twin=s3d.transform(s3d.copy(side),mirror=&class="tok-comment">#39;x39;)
solid=s3d.group(&class="tok-comment">#39;fork_metal39;,crown,side,twin)
s3d.material(solid,kind=&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#8d929539;)
wheel=s3d.at(extended_caster_wheel(),y=20,z=-29)
s3d.joint(wheel_joint,wheel,s3d.local(solid,x=0,y=20,z=10),kind=&class="tok-comment">#39;continuousclass="tok-string">39;,axis=39;-X39;)
return s3d.group(&class="tok-comment">#39;extended_caster_fork39;,solid,wheel)
def extended_caster_wheel(w=24,d=77):
tire=s3d.at(s3d.cylinder(&class="tok-comment">#39;tire39;,d=d,h=w),ry=90,x=-w/2,z=d/2)
s3d.fillet(tire,r=4)
s3d.material(tire,kind=&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#44484a39;)
return s3d.group(&class="tok-comment">#39;extended_caster_wheel39;,tire)
def locking_pin(w=69,d=45,h=14,shaft_d=9,handle_d=4,barrel_l=20,handle_y=-7.5):
barrel=s3d.at(s3d.cylinder(&class="tok-comment">#39;barrel39;,d=h,h=barrel_l),rx=-90,y=-d/2,z=h/2)
pin=s3d.at(s3d.cylinder(&class="tok-comment">#39;pin39;,d=shaft_d,h=d-barrel_l),rx=-90,y=-d/2+barrel_l,z=h/2)
grip=s3d.at(s3d.cylinder(&class="tok-comment">#39;grip39;,d=handle_d,h=w),ry=90,x=-w/2,y=handle_y,z=h/2)
ob=s3d.group(&class="tok-comment">#39;locking_pin39;,barrel,pin,grip)
s3d.material(ob,kind=&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#777d8039;)
return ob