import sand3d as s3d
def probe_system():
root=s3d.at(body_01(),x=0,y=0,z=0)
return s3d.assembly(&class="tok-comment">#39;probe_system39;,root)
def body_01(w=350,d=380,h=82,x=-243,y=-265,z=5,shift=21,seam=4,px=305,py=80,pz=32,pw=65,pd=110,shaft=390,wire_d=7.5,recess_h=54,step=10,shaft_angle=98,neck_angle=-110,turn=-15):
ph=pw
outline=s3d.poly([(-w/2,0),(w/2,0),(w/2-shift,h),(-w/2,h)])
lower=s3d.at(s3d.extrude(&class="tok-comment">#39;lower_housing39;,outline,h=d),x=x,y=y+d/2,z=z,rx=90)
s3d.pocket(lower,s3d.rect(w=d/2,d=recess_h),depth=recess_h+seam,on=s3d.bbox(lower,&class="tok-comment">#39;-X39;))
upper=s3d.at(s3d.copy(lower),x=x-shift,z=z+h+seam)
s3d.material(lower,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#b7b9b539;)
s3d.material(upper,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#b7b9b539;)
grip=s3d.at(s3d.loft(&class="tok-comment">#39;probe_grip39;,s3d.station(z=0,w=pw-shift,d=pd-shift,n=3),s3d.station(z=ph/2-z,w=pw,d=pd,n=3),s3d.station(z=ph,w=pw-step,d=py,y=step,n=3)),x=px,y=py,z=pz)
collar=s3d.at(s3d.tube(&class="tok-comment">#39;shaft_collar39;,d=recess_h,d_in=pw-shift,h=shift),x=px-shift,y=step+step/2,z=pz+ph/2,rx=shaft_angle,rz=turn)
bridge=s3d.at(s3d.cylinder(&class="tok-comment">#39;stepped_connector39;,d=py/2,h=py/2),x=px-shift,y=py/2,z=pz+ph/2,rx=shaft_angle,rz=turn)
rod=s3d.at(s3d.cylinder(&class="tok-comment">#39;shaft39;,d=step,h=shaft),x=px-shift,y=0,z=pz+ph/2,rx=shaft_angle,rz=turn)
neck=s3d.at(s3d.cone(&class="tok-comment">#39;cable_neck39;,d=py/2,h=pd,d2=step),x=px+step+z,y=py+pd/2-step,z=ph-z,rx=neck_angle,rz=turn)
s3d.material(grip,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#343b3b39;)
s3d.material(collar,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#30363539;)
s3d.material(bridge,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#30363539;)
s3d.material(rod,&class="tok-comment">#39;steelclass="tok-string">39;,color=39;#a3a7a739;)
s3d.material(neck,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#33393839;)
cable=s3d.wire(&class="tok-comment">#39;outer_cable39;,s3d.spline([(-py,y-pd+wire_d,ph*2-wire_d),(pd/2,-w,ph+py/2),(pd+step,y-z,ph-z),(py+step,-d/2,wire_d+z),(0,-pd,wire_d+z),(-shift,py/2-step,wire_d),(-shift,py*2,wire_d),(py,w-step,wire_d),(pd*2,d+ph-z,wire_d),(w-step,d+ph-z,wire_d),(d+step*2,d-step,wire_d),(d+step*2+z,py*3,wire_d),(d+step*4,py*2+step,wire_d),(shaft+z,py,wire_d),(w+z,-pd/2+z,step*2),(px-step-z,-ph,ph+z)]),d=wire_d)
cable2=s3d.wire(&class="tok-comment">#39;inner_cable39;,s3d.spline([(-py+step,y-pd+z,ph-step*2+z),(step*3,-w,step*2),(step*2,y-step-z,wire_d),(ph,y+step*3,wire_d),(py*2+step*2,y+z,wire_d),(pd*2,-d/2,wire_d),(pd*2,-pd+step,wire_d),(py*2+step,-ph-z,wire_d),(step*2,-ph,wire_d),(-step*2,0,wire_d),(0,py*2+step,wire_d),(pd+step,w,wire_d),(py*3,d+step*3,wire_d),(shaft-ph+z,w,wire_d),(w-z,py+pd+ph/2,step*2)]),d=wire_d)
coil=s3d.at(s3d.sweep(&class="tok-comment">#39;cable_coil39;,s3d.circle(d=wire_d),s3d.ellipse(w=py*2+step*2,d=pd*2)),x=py-step,y=py+ph-z,z=wire_d)
for ob in (cable,cable2,coil):
s3d.material(ob,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#33383839;)
parent=s3d.group(&class="tok-comment">#39;fixed_body39;,lower,upper,grip,collar,bridge,rod,neck,cable,cable2,coil)
b6=s3d.at(button_06(),on=s3d.local(parent,310.5,97,99))
b7=s3d.at(button_07(),on=s3d.local(parent,-98.5,-421,122))
b5=s3d.at(button_05(),on=s3d.local(parent,306,80.5,97))
b3=s3d.at(button_03(),on=s3d.local(parent,302,65,95))
b1=s3d.at(button_01(),on=s3d.local(parent,322,76.5,97))
b4=s3d.at(button_04(),on=s3d.local(parent,290,85,97))
b2=s3d.at(button_02(),on=s3d.local(parent,-78,-421,36))
s3d.joint(&class="tok-comment">#39;joint_button_06_joint_00class="tok-string">39;,b6,on=s3d.local(parent,310,97,103,rx=8.2,ry=0),kind=39;prismaticclass="tok-string">39;,axis=39;normal39;,range=(0,0.0001))
s3d.joint(&class="tok-comment">#39;joint_button_07_joint_00class="tok-string">39;,b7,on=s3d.local(parent,-98,-421,132),kind=39;prismaticclass="tok-string">39;,axis=39;+X39;,range=(-1.8,0))
s3d.joint(&class="tok-comment">#39;joint_button_05_joint_00class="tok-string">39;,b5,on=s3d.local(parent,306,81,101,rx=8.8,ry=0),kind=39;prismaticclass="tok-string">39;,axis=39;normal39;,range=(0,0.0001))
s3d.joint(&class="tok-comment">#39;joint_button_03_joint_00class="tok-string">39;,b3,on=s3d.local(parent,302,65,99,rx=8.2,ry=0),kind=39;prismaticclass="tok-string">39;,axis=39;normal39;,range=(0,0.0001))
s3d.joint(&class="tok-comment">#39;joint_button_01_joint_00class="tok-string">39;,b1,on=s3d.local(parent,322,76,101,rx=8.1,ry=0),kind=39;prismaticclass="tok-string">39;,axis=39;normal39;,range=(0,0.0001))
s3d.joint(&class="tok-comment">#39;joint_button_04_joint_00class="tok-string">39;,b4,on=s3d.local(parent,290,85,101,rx=7.6,ry=0),kind=39;prismaticclass="tok-string">39;,axis=39;normal39;,range=(0,0.0001))
s3d.joint(&class="tok-comment">#39;joint_button_02_joint_00class="tok-string">39;,b2,on=s3d.local(parent,-78,-421,45),kind=39;prismaticclass="tok-string">39;,axis=39;+X39;,range=(-1.8,0))
return s3d.group(&class="tok-comment">#39;body_0139;,parent,b6,b7,b5,b3,b1,b4,b2)
def button_06(d=11,h=5):
ob=s3d.cylinder(&class="tok-comment">#39;button_0639;,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#657e7639;)
return s3d.group(&class="tok-comment">#39;button_0639;,ob)
def button_07(d=18,h=7):
ob=s3d.at(s3d.cylinder(&class="tok-comment">#39;button_0739;,d=d,h=h),x=-h/2,z=d/2,ry=90)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#343b3839;)
return s3d.group(&class="tok-comment">#39;button_0739;,ob)
def button_05(d=12,h=6):
ob=s3d.cylinder(&class="tok-comment">#39;button_0539;,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#657e7639;)
return s3d.group(&class="tok-comment">#39;button_0539;,ob)
def button_03(d=12,h=5):
ob=s3d.cylinder(&class="tok-comment">#39;button_0339;,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#657e7639;)
return s3d.group(&class="tok-comment">#39;button_0339;,ob)
def button_01(d=12,h=5):
ob=s3d.cylinder(&class="tok-comment">#39;button_0139;,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#657e7639;)
return s3d.group(&class="tok-comment">#39;button_0139;,ob)
def button_04(d=12,h=5):
ob=s3d.cylinder(&class="tok-comment">#39;button_0439;,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#657e7639;)
return s3d.group(&class="tok-comment">#39;button_0439;,ob)
def button_02(d=18,h=6):
ob=s3d.at(s3d.cylinder(&class="tok-comment">#39;button_0239;,d=d,h=h),x=-h/2,z=d/2,ry=90)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#343b3839;)
return s3d.group(&class="tok-comment">#39;button_0239;,ob)