import sand3d as s3d
def iv_stand():
root = s3d.at(base_and_lower_upright(), x=-8.5, y=9.5, z=43)
a = s3d.at(caster_mount_front_diagonal(), x=254, y=123.5, z=16)
b = s3d.at(caster_mount_front_diagonal(wheel_joint=&class="tok-comment">#39;joint_wheel_02_joint_0039;), x=-271, y=123.5, z=16)
p = s3d.at(upper_pole(), x=-8.5, y=9, z=980)
c = s3d.at(caster_mount_rear(), x=-9, y=-332, z=16)
k = s3d.at(clamp_knob(), x=-8.5, y=37.5, z=1573)
e = s3d.at(caster_mount_front(), x=-9, y=274.5, z=17)
f = s3d.at(caster_mount_rear_diagonal(), x=254, y=-179.5, z=16)
g = s3d.at(caster_mount_rear_diagonal(wheel_joint=&class="tok-comment">#39;joint_wheel_03_joint_0039;), x=-271, y=-179.5, z=16)
for child, name, x, y in [(a,&class="tok-comment">#39;06class="tok-string">39;,262,151),(b,39;02class="tok-string">39;,-263,151),(c,39;04class="tok-string">39;,-1,-304),(e,39;01class="tok-string">39;,-1,303),(f,39;05class="tok-string">39;,262,-152),(g,39;0339;,-263,-152)]:
s3d.joint(&class="tok-comment">#39;joint_wheelAttachment_class="tok-string">39;+name+39;_joint_00class="tok-string">39;, child, s3d.local(root,x=x,y=y,z=28), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
s3d.joint(&class="tok-comment">#39;joint_pole_01_joint_00class="tok-string">39;,p,s3d.local(root,x=0,y=0,z=-43),kind=39;prismaticclass="tok-string">39;,axis=39;+Z39;,range=(0,450))
s3d.joint(&class="tok-comment">#39;joint_knob_01_joint_00class="tok-string">39;,k,s3d.local(root,x=-1,y=30,z=1550),kind=39;continuousclass="tok-string">39;,axis=39;+Y39;)
return s3d.assembly(&class="tok-comment">#39;iv_stand39;,root,a,b,p,c,k,e,f,g)
def base_and_lower_upright(pole_d=32, pole_h=811, hub_d=190, t=18, arm_w=56, reach=303, bend=150, rise=65, clamp_z=1530):
hub=s3d.cylinder(&class="tok-comment">#39;hub39;,d=hub_d,h=t)
arm=s3d.loft(&class="tok-comment">#39;curved_arm39;,s3d.station(z=0,w=arm_w,d=t,n=4),s3d.station(z=bend,w=arm_w,d=t,n=4),s3d.station(z=reach-40,w=arm_w,d=t,y=-rise,n=4),s3d.station(z=reach,w=arm_w,d=t,y=-rise,n=4))
arm=s3d.at(arm,rx=-90)
arms=s3d.at(arm,on=s3d.ring(n=6,r=0,start=0))
hub=s3d.join(hub,arms)
pole=s3d.cylinder(&class="tok-comment">#39;lower_tube39;,d=pole_d,h=pole_h)
thin=s3d.at(s3d.cylinder(&class="tok-comment">#39;exposed_connection39;,d=2,h=130),z=pole_h)
clamp=s3d.at(s3d.cylinder(&class="tok-comment">#39;clamp39;,d=28,h=35),z=clamp_z)
hub=s3d.join(hub,pole,thin)
s3d.material(hub,&class="tok-comment">#39;chromeclass="tok-string">39;,color=39;#aeb3b639;)
s3d.material(clamp,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#51575a39;)
return s3d.group(&class="tok-comment">#39;base_and_lower_upright39;,hub,clamp)
def caster_mount_front_diagonal(w=32,d=113,h=102,wheel_joint=&class="tok-comment">#39;joint_wheel_06_joint_0039;):
solid=caster_fork(w=w,d=d,h=h)
wheel=s3d.at(caster_wheel_front_diagonal(),y=11.5,z=-16)
part=s3d.group(&class="tok-comment">#39;caster_mount_front_diagonal39;,solid,wheel)
s3d.joint(wheel_joint,wheel,s3d.local(part,x=0,y=11.5,z=22),kind=&class="tok-comment">#39;continuousclass="tok-string">39;,axis=39;-X39;)
return part
def caster_fork(w=32,d=113,h=102,t=5,axle_z=22,axle_y=12):
profile=s3d.poly([(-d/2,h*.72),(d/2-18,h*.72),(d/2,axle_z+8),(axle_y+12,0),(axle_y-15,0),(axle_y-36,axle_z),(axle_y-20,h*.55),(-d/2,h*.64)])
cheek=s3d.extrude(&class="tok-comment">#39;fork_cheek39;,profile,h=t)
cheek=s3d.at(cheek,rx=90,rz=90,x=-w/2,z=0)
other=s3d.at(s3d.copy(cheek),x=w/2-t)
bridge=s3d.at(s3d.box(&class="tok-comment">#39;fork_bridge39;,w=w,d=40,h=t),y=d/2-22,z=h*.68)
stem=s3d.at(s3d.cylinder(&class="tok-comment">#39;swivel39;,d=19,h=h*.35),y=d/2-19,z=h*.65)
brake=s3d.at(s3d.box(&class="tok-comment">#39;brake39;,w=w-4,d=40,h=t),y=-d/2+20,z=h*.72)
solid=s3d.join(bridge,cheek,other,stem,brake)
s3d.material(solid,&class="tok-comment">#39;brushed_steelclass="tok-string">39;,color=39;#878e9339;)
return solid
def caster_wheel_front_diagonal(w=18,d=76):
solid=wheel_solid(w=w,d=d)
return s3d.group(&class="tok-comment">#39;caster_wheel_front_diagonal39;,solid)
def wheel_solid(w=18,d=76):
tire=s3d.cylinder(&class="tok-comment">#39;wheel39;,d=d,h=w)
tire=s3d.fillet(tire,r=w/4,edges=&class="tok-comment">#39;top bottom39;)
tire=s3d.at(tire,ry=90,x=-w/2,z=d/2)
s3d.material(tire,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#41474b39;)
return tire
def upper_pole(d=18,h=805):
solid=s3d.cylinder(&class="tok-comment">#39;upper_tube39;,d=d,h=h)
s3d.material(solid,&class="tok-comment">#39;chromeclass="tok-string">39;,color=39;#c1c6c939;)
crown=s3d.at(hook_crown(),y=-0.5,z=722)
s3d.joint(&class="tok-comment">#39;joint_hooks_01_joint_00class="tok-string">39;,crown,s3d.local(solid,x=0,y=0,z=887),kind=39;continuousclass="tok-string">39;,axis=39;+Z39;)
return s3d.group(&class="tok-comment">#39;upper_pole39;,solid,crown)
def hook_crown(stem_d=18,stem_h=175,wire_d=6,reach=116,tip_h=245):
stem=s3d.cylinder(&class="tok-comment">#39;crown_stem39;,d=stem_d,h=stem_h)
path=s3d.spline([(0,0,85),(15,0,170),(45,0,220),(85,0,tip_h),(reach,0,230),(reach-5,0,205),(85,0,200),(72,0,220),(76,0,230)])
hook=s3d.wire(&class="tok-comment">#39;crown_hook39;,path,d=wire_d)
hooks=s3d.at(hook,on=s3d.ring(n=4,r=0))
low=s3d.wire(&class="tok-comment">#39;lower_hook39;,s3d.spline([(0,0,110),(-8,18,80),(-35,42,68),(-65,68,55),(-75,78,28),(-64,65,4),(-45,45,10),(-46,46,40),(-56,56,48)]),d=wire_d)
s3d.material(stem,&class="tok-comment">#39;chromeclass="tok-string">39;,color=39;#b6bdc239;)
s3d.material(hooks,&class="tok-comment">#39;chromeclass="tok-string">39;,color=39;#b6bdc239;)
s3d.material(low,&class="tok-comment">#39;chromeclass="tok-string">39;,color=39;#b6bdc239;)
return s3d.group(&class="tok-comment">#39;hook_crown39;,stem,hooks,low)
def caster_mount_rear(w=32,d=112,h=101):
solid=caster_fork(w=w,d=d,h=h)
wheel=s3d.at(caster_wheel_rear(),x=0.5,y=12,z=-16)
part=s3d.group(&class="tok-comment">#39;caster_mount_rear39;,solid,wheel)
s3d.joint(&class="tok-comment">#39;joint_wheel_04_joint_00class="tok-string">39;,wheel,s3d.local(part,x=0,y=12,z=22),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
return part
def caster_wheel_rear(w=19,d=76):
return s3d.group(&class="tok-comment">#39;caster_wheel_rear39;,wheel_solid(w=w,d=d))
def clamp_knob(d=41,t=21):
solid=s3d.cylinder(&class="tok-comment">#39;knob39;,d=d,h=t)
solid=s3d.at(solid,rx=90,y=t/2,z=d/2)
s3d.material(solid,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#42484c39;)
return s3d.group(&class="tok-comment">#39;clamp_knob39;,solid)
def caster_mount_front(w=32,d=111,h=100):
solid=caster_fork(w=w,d=d,h=h)
wheel=s3d.at(caster_wheel_front(),x=0.5,y=13,z=-17)
part=s3d.group(&class="tok-comment">#39;caster_mount_front39;,solid,wheel)
s3d.joint(&class="tok-comment">#39;joint_wheel_01_joint_00class="tok-string">39;,wheel,s3d.local(part,x=0,y=13,z=21),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
return part
def caster_wheel_front(w=19,d=76):
return s3d.group(&class="tok-comment">#39;caster_wheel_front39;,wheel_solid(w=w,d=d))
def caster_mount_rear_diagonal(w=32,d=113,h=103,wheel_joint=&class="tok-comment">#39;joint_wheel_05_joint_0039;):
solid=caster_fork(w=w,d=d,h=h)
wheel=s3d.at(caster_wheel_rear_diagonal(),y=11.5,z=-16)
part=s3d.group(&class="tok-comment">#39;caster_mount_rear_diagonal39;,solid,wheel)
s3d.joint(wheel_joint,wheel,s3d.local(part,x=0,y=11.5,z=22),kind=&class="tok-comment">#39;continuousclass="tok-string">39;,axis=39;-X39;)
return part
def caster_wheel_rear_diagonal(w=18,d=76):
return s3d.group(&class="tok-comment">#39;caster_wheel_rear_diagonal39;,wheel_solid(w=w,d=d))