import sand3d as s3d
def terminal():
base = s3d.at(terminal_base(), z=0)
panel = s3d.at(screen(), y=-93, z=182)
s3d.joint(&class="tok-comment">#39;joint_sm_screen_c01_joint_00class="tok-string">39;, panel, s3d.local(base, x=-1, y=-70, z=268), kind=39;revoluteclass="tok-string">39;, axis=39;+X39;, range=(0,0.000001))
return s3d.assembly(&class="tok-comment">#39;terminal39;, base, panel)
def terminal_base(w=339, d=250, h=77, foot=4, r=25, support_w=50, support_d=25, support_h=120, sy=-65, t=1.5, top_z=209, top_h=82, rod_h=147, rod_d=10, rod_tip=2, rod_y=62, rod_x=-11, pitch=26, inset_d=27):
profile = s3d.poly([(-w/2,0),(w/2,0),(w/2,h-r),s3d.tangent_arc(to=(w/2-r,h)),(-w/2+r,h),s3d.tangent_arc(to=(-w/2,h-r))])
base = s3d.at(s3d.extrude(&class="tok-comment">#39;housing39;, profile, h=d), y=d/2, z=foot, rx=90)
feet = s3d.at(s3d.cylinder(&class="tok-comment">#39;feet39;, d=20, h=foot+t), on=s3d.grid(nx=3, ny=2, px=137, py=176))
upright = s3d.at(s3d.box(&class="tok-comment">#39;support_web39;, w=support_w, d=t, h=support_h), y=sy, z=h+foot)
flange = s3d.at(s3d.box(&class="tok-comment">#39;support_flange39;, w=t, d=support_d, h=support_h), x=(support_w-t)/2, y=sy+support_d/2, z=h+foot)
twin = s3d.transform(s3d.copy(flange), mirror=&class="tok-comment">#39;x39;)
mount = s3d.at(s3d.box(&class="tok-comment">#39;mount_frame39;, w=support_w, d=t, h=top_h), y=sy, z=top_z)
s3d.pocket(mount, s3d.rect(w=support_w-2*8, d=top_h-2*8), depth=t*2, on=s3d.local(mount, y=-t/2, z=top_h/2, rx=90))
neck = s3d.at(s3d.box(&class="tok-comment">#39;neck39;, w=18, d=t, h=top_z-h-foot), y=sy, z=h+foot)
strip = s3d.wire(&class="tok-comment">#39;curved_strip39;, path=s3d.spline([(0,sy+support_d,h+foot),(0,sy+support_d,h+foot+support_h/2),(0,sy+support_d/2,h+foot+support_h-t),(0,sy-10,h+foot+support_h)]), d=4)
rods = s3d.at(s3d.cone(&class="tok-comment">#39;aerial39;, d=rod_d, d2=rod_tip, h=rod_h), on=s3d.grid(nx=2, px=pitch), x=rod_x+pitch/2, y=rod_y, z=h+foot)
ring = s3d.at(s3d.tube(&class="tok-comment">#39;side_ring39;, d=inset_d, d_in=inset_d-4, h=t), y=d/2, z=h/2, rx=-90)
s3d.material(base, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#55595c39;)
for ob in [feet,upright,flange,twin,mount,neck,strip,rods,ring]:
s3d.material(ob, &class="tok-comment">#39;aluminiumclass="tok-string">39;, color=39;#70747739;)
return s3d.group(&class="tok-comment">#39;terminal_base39;, base, feet, upright, flange, twin, mount, neck, strip, rods, ring)
def screen(w=250, d=25, h=175.1, r=10, face_y=-31, recess=3, rim=13, back_w=228, back_h=146, back_d=18, mount_w=102, mount_h=108, mount_d=1.5, rear_w=204, rear_h=130, pivot_d=16, pivot_w=64):
solid = s3d.at(s3d.extrude(&class="tok-comment">#39;bezel39;, s3d.rect(w=w, d=h, r=r), h=d), y=face_y+d, z=h/2, rx=90)
s3d.pocket(solid, s3d.rect(w=w-2*rim, d=h-2*rim), depth=recess, on=s3d.local(solid, z=d))
back = s3d.at(s3d.loft(&class="tok-comment">#39;rear_cover39;, s3d.station(z=0, w=back_w, d=back_h, n=8), s3d.station(z=back_d, w=rear_w, d=rear_h, n=8)), y=face_y+d-1, z=h/2, rx=-90)
mount = s3d.at(s3d.box(&class="tok-comment">#39;rear_mount39;, w=mount_w, d=mount_d, h=mount_h), y=face_y+d+back_d, z=rim)
pivot = s3d.at(s3d.cylinder(&class="tok-comment">#39;pivot39;, d=pivot_d, h=pivot_w), x=-pivot_w/2, y=23, z=86, ry=90)
solid = s3d.join(solid, back, mount, pivot)
s3d.material(solid, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#272a2d39;)
button_six_placed = s3d.at(button_six(), x=39.5, y=-6.5, z=3)
button_three_placed = s3d.at(button_three(), x=76, y=-6.5, z=3)
button_two_placed = s3d.at(button_two(), x=88, y=-6.5, z=3)
button_five_placed = s3d.at(button_five(), x=52, y=-6.5, z=3)
button_one_placed = s3d.at(button_one(), x=97, y=-6, z=4)
button_four_placed = s3d.at(button_four(), x=64, y=-6.5, z=3)
result = s3d.group(&class="tok-comment">#39;screen39;, solid, button_six_placed, button_three_placed, button_two_placed, button_five_placed, button_one_placed, button_four_placed)
s3d.joint(&class="tok-comment">#39;joint_sm_button6_c01_joint_00class="tok-string">39;, button_six_placed, s3d.local(result, x=39, y=-6, z=6), kind=39;prismaticclass="tok-string">39;, axis=39;+Y39;, range=(0,0.000001))
s3d.joint(&class="tok-comment">#39;joint_sm_button3_c01_joint_00class="tok-string">39;, button_three_placed, s3d.local(result, x=76, y=-6, z=6), kind=39;prismaticclass="tok-string">39;, axis=39;+Y39;, range=(0,0.000001))
s3d.joint(&class="tok-comment">#39;joint_sm_button2_c01_joint_00class="tok-string">39;, button_two_placed, s3d.local(result, x=88, y=-6, z=6), kind=39;prismaticclass="tok-string">39;, axis=39;+Y39;, range=(0,0.000001))
s3d.joint(&class="tok-comment">#39;joint_sm_button5_c01_joint_00class="tok-string">39;, button_five_placed, s3d.local(result, x=52, y=-6, z=6), kind=39;prismaticclass="tok-string">39;, axis=39;+Y39;, range=(0,0.000001))
s3d.joint(&class="tok-comment">#39;joint_sm_button1_c01_joint_00class="tok-string">39;, button_one_placed, s3d.local(result, x=97, y=-6, z=6), kind=39;prismaticclass="tok-string">39;, axis=39;+Y39;, range=(0,0.000001))
s3d.joint(&class="tok-comment">#39;joint_sm_button4_c01_joint_00class="tok-string">39;, button_four_placed, s3d.local(result, x=64, y=-6, z=6), kind=39;prismaticclass="tok-string">39;, axis=39;+Y39;, range=(0,0.000001))
return result
def button_six(w=11, d=3, h=5):
ob = s3d.box(&class="tok-comment">#39;button_six39;, w=w, d=d, h=h)
s3d.material(ob, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#34383b39;)
return s3d.group(&class="tok-comment">#39;button_six39;, ob)
def button_three(w=10, d=3, h=5):
ob = s3d.box(&class="tok-comment">#39;button_three39;, w=w, d=d, h=h)
s3d.material(ob, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#34383b39;)
return s3d.group(&class="tok-comment">#39;button_three39;, ob)
def button_two(w=10, d=3, h=5):
ob = s3d.box(&class="tok-comment">#39;button_two39;, w=w, d=d, h=h)
s3d.material(ob, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#34383b39;)
return s3d.group(&class="tok-comment">#39;button_two39;, ob)
def button_five(w=10, d=3, h=5):
ob = s3d.box(&class="tok-comment">#39;button_five39;, w=w, d=d, h=h)
s3d.material(ob, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#34383b39;)
return s3d.group(&class="tok-comment">#39;button_five39;, ob)
def button_one(w=2, d=2, h=4):
ob = s3d.box(&class="tok-comment">#39;button_one39;, w=w, d=d, h=h)
s3d.material(ob, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#34383b39;)
return s3d.group(&class="tok-comment">#39;button_one39;, ob)
def button_four(w=10, d=3, h=5):
ob = s3d.box(&class="tok-comment">#39;button_four39;, w=w, d=d, h=h)
s3d.material(ob, &class="tok-comment">#39;plasticclass="tok-string">39;, color=39;#34383b39;)
return s3d.group(&class="tok-comment">#39;button_four39;, ob)