import sand3d as s3d
def cabinet():
body = s3d.at(body_01(), x=-39, y=19)
a = s3d.at(switch_02(), x=51.5, y=107.5, z=798)
b = s3d.at(switch_04(), x=-130, y=107.5, z=798)
c = s3d.at(switch_05(), x=-221, y=107.5, z=798)
d = s3d.at(switch_01(), x=142, y=107.5, z=798)
e = s3d.at(switch_03(), x=-39, y=107.5, z=798)
s3d.joint(&class="tok-comment">#39;joint_switch_02_joint_00class="tok-string">39;, a, on=s3d.local(body, x=91, y=82, z=801), axis=39;-X39;, range=(0,100))
s3d.joint(&class="tok-comment">#39;joint_switch_04_joint_00class="tok-string">39;, b, on=s3d.local(body, x=-91, y=82, z=801), axis=39;-X39;, range=(0,100))
s3d.joint(&class="tok-comment">#39;joint_switch_05_joint_00class="tok-string">39;, c, on=s3d.local(body, x=-182, y=82, z=801), axis=39;-X39;, range=(0,100))
s3d.joint(&class="tok-comment">#39;joint_switch_01_joint_00class="tok-string">39;, d, on=s3d.local(body, x=181, y=82, z=801), axis=39;-X39;, range=(0,100))
s3d.joint(&class="tok-comment">#39;joint_switch_03_joint_00class="tok-string">39;, e, on=s3d.local(body, x=0, y=82, z=801), axis=39;-X39;, range=(0,100))
return s3d.assembly(&class="tok-comment">#39;cabinet39;, body,a,b,c,d,e)
def body_01(w=450,d=314,h=831,t=2,lower=427,roof=750,front=97,rear=-137,bay_bottom=399,bay_top=694,bay_rear=-106,bay_foot=-31,divider=44,cap_d=77,cap_h=19):
back=s3d.at(s3d.box(&class="tok-comment">#39;back39;,w=w,d=t,h=h),y=rear-19+t/2)
base=s3d.box(&class="tok-comment">#39;bottom39;,w=w,d=d,h=t)
front_panel=s3d.at(s3d.box(&class="tok-comment">#39;lower_front39;,w=w,d=t,h=lower),y=d/2-t/2)
side_profile=s3d.poly([(rear-19,0),(d/2,0),(d/2,lower),(front-19,roof),(front-19,h),(rear-19,h)])
side=s3d.at(s3d.extrude(&class="tok-comment">#39;side39;,side_profile,h=t),x=-w/2,rx=90,rz=90)
twin=s3d.transform(s3d.copy(side),mirror=&class="tok-comment">#39;x39;)
top=s3d.at(s3d.box(&class="tok-comment">#39;roof39;,w=w,d=front-rear,h=h-roof),y=(front+rear)/2-19,z=roof)
floor_profile=s3d.poly([(rear-19,bay_bottom-t),(d/2,lower-t),(d/2,lower),(rear-19,bay_bottom)])
floor=s3d.at(s3d.extrude(&class="tok-comment">#39;bay_floor39;,floor_profile,h=w),x=-w/2,rx=90,rz=90)
ramp_profile=s3d.poly([(bay_foot-19,bay_bottom),(bay_rear-19,bay_top),(bay_rear-19-t,bay_top),(bay_foot-19-t,bay_bottom)])
ramp=s3d.at(s3d.extrude(&class="tok-comment">#39;bay_back39;,ramp_profile,h=w),x=-w/2,rx=90,rz=90)
blade_profile=s3d.poly([(rear-19,bay_bottom),(d/2,lower),(front-19,roof),(rear-19,roof)])
blade=s3d.at(s3d.extrude(&class="tok-comment">#39;divider39;,blade_profile,h=t),x=-t/2,rx=90,rz=90)
cap=s3d.at(s3d.extrude(&class="tok-comment">#39;cap39;,s3d.polygon(n=8,d=cap_d),h=cap_h),y=-100-19,z=h)
fitting=s3d.at(s3d.cylinder(&class="tok-comment">#39;fitting39;,d=cap_d/3,h=cap_h),x=-136,y=-100-19,z=h)
hose_x=-w/2-cap_h
path=s3d.spline([(-w/2+cap_h,rear,h),(hose_x,rear-cap_h,h-cap_h),(hose_x-cap_h,rear,bay_top),(hose_x-cap_h/2,rear,bay_top-cap_d*2),(hose_x,0,bay_bottom+cap_d),(hose_x,front-cap_h,bay_top-cap_d),(hose_x,cap_h,bay_top),(hose_x,-cap_h,bay_top)])
hose=s3d.wire(&class="tok-comment">#39;hose39;,path,d=t*2)
end=s3d.at(s3d.cylinder(&class="tok-comment">#39;hose_end39;,d=cap_h,h=divider),x=hose_x,y=-cap_h,z=bay_top-divider)
hose_group=s3d.group(&class="tok-comment">#39;hose_assembly39;,hose,end)
hose_image=s3d.transform(s3d.copy(hose_group),mirror=&class="tok-comment">#39;x39;)
root=s3d.group(&class="tok-comment">#39;body_0139;,back,base,front_panel,side,twin,top,floor,ramp,blade,cap,fitting,hose_group,hose_image)
s3d.material(root,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#72797639;)
s3d.material(hose_group,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#353b3939;)
s3d.material(hose_image,&class="tok-comment">#39;rubberclass="tok-string">39;,color=39;#353b3939;)
return root
def switch_02(w=7,d=21,h=23):
ob=s3d.box(&class="tok-comment">#39;switch_0239;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;chrome39;)
return s3d.group(&class="tok-comment">#39;switch_0239;,ob)
def switch_04(w=8,d=21,h=23):
ob=s3d.box(&class="tok-comment">#39;switch_0439;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;chrome39;)
return s3d.group(&class="tok-comment">#39;switch_0439;,ob)
def switch_05(w=8,d=21,h=23):
ob=s3d.box(&class="tok-comment">#39;switch_0539;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;chrome39;)
return s3d.group(&class="tok-comment">#39;switch_0539;,ob)
def switch_01(w=8,d=21,h=23):
ob=s3d.box(&class="tok-comment">#39;switch_0139;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;chrome39;)
return s3d.group(&class="tok-comment">#39;switch_0139;,ob)
def switch_03(w=8,d=21,h=23):
ob=s3d.box(&class="tok-comment">#39;switch_0339;,w=w,d=d,h=h)
s3d.material(ob,&class="tok-comment">#39;chrome39;)
return s3d.group(&class="tok-comment">#39;switch_0339;,ob)