import sand3d as s3d
def upright_module():
root = s3d.at(frame_body(), x=-612, y=-58, z=-1)
b10=s3d.at(button_10(),x=-594,y=-599,z=1090)
b04=s3d.at(button_04(),x=-594,y=-599,z=1116)
b03=s3d.at(button_03(),x=-594,y=-573,z=1129)
b05=s3d.at(button_05(),x=-594,y=-586,z=1116)
b08=s3d.at(button_08(),x=-594,y=-586,z=1103)
b06=s3d.at(button_06(),x=-594,y=-573,z=1116)
b02=s3d.at(button_02(),x=-594,y=-586,z=1129)
knob=s3d.at(knob_01(),x=-591.5,y=-648.5,z=1102)
b07=s3d.at(button_07(),x=-594,y=-599,z=1103)
b09=s3d.at(button_09(),x=-594,y=-573,z=1103)
b11=s3d.at(button_11(),x=-594,y=-579.5,z=1090)
b01=s3d.at(button_01(),x=-594,y=-599,z=1129)
s3d.joint(&class="tok-comment">#39;joint_button_10_joint_00class="tok-string">39;,b10,s3d.local(root,x=16,y=-541,z=1095),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_04_joint_00class="tok-string">39;,b04,s3d.local(root,x=16,y=-541,z=1121),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_03_joint_00class="tok-string">39;,b03,s3d.local(root,x=16,y=-515,z=1134),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_05_joint_00class="tok-string">39;,b05,s3d.local(root,x=16,y=-528,z=1121),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_08_joint_00class="tok-string">39;,b08,s3d.local(root,x=16,y=-528,z=1108),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_06_joint_00class="tok-string">39;,b06,s3d.local(root,x=16,y=-515,z=1121),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_02_joint_00class="tok-string">39;,b02,s3d.local(root,x=16,y=-528,z=1134),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_knob_01_joint_00class="tok-string">39;,knob,s3d.local(root,x=16,y=-590,z=1115),kind=39;continuousclass="tok-string">39;,axis=39;-X39;)
s3d.joint(&class="tok-comment">#39;joint_button_07_joint_00class="tok-string">39;,b07,s3d.local(root,x=16,y=-541,z=1108),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_09_joint_00class="tok-string">39;,b09,s3d.local(root,x=16,y=-515,z=1108),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_11_joint_00class="tok-string">39;,b11,s3d.local(root,x=16,y=-522,z=1095),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
s3d.joint(&class="tok-comment">#39;joint_button_01_joint_00class="tok-string">39;,b01,s3d.local(root,x=16,y=-541,z=1134),kind=39;prismaticclass="tok-string">39;,axis=39;-X39;,range=(0,1))
return s3d.assembly(&class="tok-comment">#39;upright_module39;,root,b10,b04,b03,b05,b08,b06,b02,knob,b07,b09,b11,b01)
def frame_body(housing_w=143,housing_d=692,housing_h=1450,housing_z=214,housing_x=-55.5,housing_y=-399,second_w=176,second_d=509,second_y=259,rail_x=-88,rail_w=121,rail_t=17,rail_start=1670,total_h=5078,opening_w=67,opening_h=350,opening_start=1900,pitch=450,cap_w=346,cap_d=365,cap_y=578,cap_z=4830,cap_gap=180,cap_t=30,bar_x=-162,bar_d=1070,plate_w=351,plate_d=39,plate_h=459,plate_z=2729):
solids=[]
for w,d,y in [(housing_w,housing_d,housing_y),(second_w,second_d,second_y)]:
panel=s3d.at(s3d.extrude(&class="tok-comment">#39;housing39;,s3d.rect(w=w,d=d,chamfer=cap_t),h=housing_h),x=housing_x,y=y,z=housing_z)
foot=s3d.box(&class="tok-comment">#39;foot39;,w=second_w,d=d,h=housing_z)
foot=s3d.cut(foot,s3d.at(s3d.box(&class="tok-comment">#39;foot_relief39;,w=second_w,d=d-cap_t*2,h=housing_z),x=cap_t))
solids.extend([panel,s3d.at(foot,x=rail_x,y=y)])
rib=s3d.at(s3d.box(&class="tok-comment">#39;rear_spine39;,w=plate_d,d=housing_w,h=housing_h),x=bar_x+plate_d/2,y=y,z=housing_z)
solids.append(rib)
path=s3d.spline([(housing_x,y-w/2,rail_start),(housing_x,y-w/2,rail_start+housing_z),(housing_x,y+w/2,rail_start+housing_z),(housing_x,y+w/2,rail_start)])
solids.append(s3d.wire(&class="tok-comment">#39;cable_loop39;,path=path,d=rail_t/2))
for y in [-642,-157,108,410]:
rail=s3d.box(&class="tok-comment">#39;ladder_guide39;,w=rail_w,d=rail_t,h=total_h-rail_start)
for i in range(5):
tool=s3d.at(s3d.box(&class="tok-comment">#39;opening39;,w=opening_w,d=rail_w,h=opening_h),z=opening_start-rail_start+i*pitch)
rail=s3d.cut(rail,tool)
solids.append(s3d.at(rail,x=rail_x,y=y,z=rail_start))
for z in [cap_z,cap_z+cap_gap]:
solids.append(s3d.at(s3d.box(&class="tok-comment">#39;crossbar39;,w=cap_t,d=bar_d,h=cap_t),x=bar_x,y=(410-642)/2,z=z))
solids.append(s3d.at(s3d.box(&class="tok-comment">#39;end_plate39;,w=cap_w,d=cap_d,h=cap_t),x=rail_x,y=cap_y,z=z))
solids.append(s3d.at(s3d.box(&class="tok-comment">#39;intermediate_plate39;,w=plate_w,d=plate_d,h=plate_h),x=-rail_x,y=410,z=plate_z))
for ob in solids:
s3d.material(ob,&class="tok-comment">#39;aluminiumclass="tok-string">39;,color=39;#777b7d39;)
return s3d.group(&class="tok-comment">#39;frame_body39;,*solids)
def button_10(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_1039;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_1039;,ob)
def button_04(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0439;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0439;,ob)
def button_03(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0339;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0339;,ob)
def button_05(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0539;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0539;,ob)
def button_08(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0839;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0839;,ob)
def button_06(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0639;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0639;,ob)
def button_02(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0239;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0239;,ob)
def knob_01(w=9,d=25):
ob=s3d.at(s3d.cylinder(&class="tok-comment">#39;knob39;,d=d,h=w),x=-w/2,z=d/2,ry=90)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#29292939;)
return s3d.group(&class="tok-comment">#39;knob_0139;,ob)
def button_07(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0739;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0739;,ob)
def button_09(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0939;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0939;,ob)
def button_11(w=4,d=23,h=10):
ob=s3d.box(&class="tok-comment">#39;button_1139;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_1139;,ob)
def button_01(w=4,d=10,h=10):
ob=s3d.box(&class="tok-comment">#39;button_0139;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#33333339;)
return s3d.group(&class="tok-comment">#39;button_0139;,ob)