import sand3d as s3d
def suspended_workstation():
cap = s3d.at(round_cap(), x=791.5, y=791, z=2406)
arm = s3d.at(cross_arm(), x=396, y=788.5, z=2261)
s3d.joint(&class="tok-comment">#39;joint_arm_01_joint_00class="tok-string">39;, arm, on=s3d.local(cap, x=0, y=0, z=94), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
return s3d.assembly(&class="tok-comment">#39;suspended_workstation39;, cap, arm)
def round_cap(d=561, h=215, bottom_d=500):
solid = s3d.cone(&class="tok-comment">#39;round_cap39;, d=bottom_d, h=h, d2=d)
s3d.material(solid, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#dddeda39;)
return s3d.group(&class="tok-comment">#39;round_cap_group39;, solid)
def cross_arm(w=1016, d=183, beam_h=116, boss_d=154, boss_h=62, top_h=123):
beam = s3d.at(s3d.extrude(&class="tok-comment">#39;cross_arm39;, s3d.rect(w=w, d=d, r=d/3), h=beam_h), z=4)
boss = s3d.at(s3d.cylinder(&class="tok-comment">#39;cap_pivot39;, d=boss_d, h=top_h), x=w/2-112, y=2.5, z=beam_h)
s3d.material(beam, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#d2d4d339;)
s3d.material(boss, &class="tok-comment">#39;steelclass="tok-string">39;, color=39;#b5b9ba39;)
child = s3d.at(return_arm(), x=-399, y=-393.5, z=-228)
host = s3d.group(&class="tok-comment">#39;cross_arm_group39;, beam, boss, child)
s3d.joint(&class="tok-comment">#39;joint_arm_02_joint_00class="tok-string">39;, child, on=s3d.local(host, x=-395, y=3, z=62), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
return host
def return_arm(w=183, d=1016, beam_h=116, boss_d=154, boss_h=185):
beam = s3d.at(s3d.extrude(&class="tok-comment">#39;return_arm39;, s3d.rect(w=w, d=d, r=w/3), h=beam_h), x=4, z=47)
boss = s3d.at(s3d.cylinder(&class="tok-comment">#39;elbow_pivot39;, d=boss_d, h=boss_h), x=4, y=396, z=105)
s3d.material(beam, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#d2d4d339;)
s3d.material(boss, &class="tok-comment">#39;steelclass="tok-string">39;, color=39;#b5b9ba39;)
child = s3d.at(channel_column(), x=11.5, y=-403.5, z=-2033)
host = s3d.group(&class="tok-comment">#39;return_arm_group39;, beam, boss, child)
s3d.joint(&class="tok-comment">#39;joint_column_01_joint_00class="tok-string">39;, child, on=s3d.local(host, x=3, y=-395, z=-2033), kind=39;continuousclass="tok-string">39;, axis=39;+Z39;)
return host
def channel_column(w=303, d=235, h=1204, rod_h=881, rod_d=8, rod_pitch=78):
profile = s3d.poly([(-w/2,-42),(-55,-d/2),(48,-d/2),(w/2,-42),(w/2,74),(63,99),(-70,99),(-w/2,74)])
solid = s3d.at(s3d.extrude(&class="tok-comment">#39;column39;, profile, h=h), x=-7.5, y=-8)
rods = s3d.at(s3d.cylinder(&class="tok-comment">#39;suspension_rod39;, d=rod_d, h=rod_h), on=s3d.grid(nx=2, ny=2, px=rod_pitch, py=rod_pitch), x=-8.5, y=8.5, z=h)
s3d.material(solid, &class="tok-comment">#39;aluminiumclass="tok-string">39;, color=39;#adb4b439;)
s3d.material(rods, &class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#c6cccd39;)
upper = s3d.at(upper_shelf(), x=-8.5, y=330.5, z=704)
handle = s3d.at(positive_handle(), x=174, y=10.5, z=1022)
other = s3d.at(negative_handle(), x=-189.5, y=10.5, z=1023)
lower = s3d.at(lower_tray(), x=-8, y=328.5, z=373)
host = s3d.group(&class="tok-comment">#39;channel_column_group39;, solid, rods, upper, handle, other, lower)
s3d.joint(&class="tok-comment">#39;joint_plate_01_joint_00class="tok-string">39;, upper, on=s3d.local(host, x=-8, y=100, z=751), kind=39;prismaticclass="tok-string">39;, axis=39;+Z39;, range=(-238.7,334.4))
s3d.joint(&class="tok-comment">#39;joint_handle_01_joint_00class="tok-string">39;, handle, on=s3d.local(host, x=142, y=11, z=1122), kind=39;revoluteclass="tok-string">39;, axis=39;+X39;, range=(0,90))
s3d.joint(&class="tok-comment">#39;joint_handle_02_joint_00class="tok-string">39;, other, on=s3d.local(host, x=-158, y=11, z=1122), kind=39;revoluteclass="tok-string">39;, axis=39;+X39;, range=(-90,0))
s3d.joint(&class="tok-comment">#39;joint_plate_02_joint_00class="tok-string">39;, lower, on=s3d.local(host, x=-8, y=100, z=428), kind=39;prismaticclass="tok-string">39;, axis=39;+Z39;, range=(-307.4,117.5))
return host
def upper_shelf(w=443, d=430, t=25, h=142, carriage_w=106, carriage_d=32):
plate = s3d.at(s3d.extrude(&class="tok-comment">#39;upper_plate39;, s3d.rect(w=w, d=d, r=5), h=t), y=13, z=h-t)
mount = s3d.at(s3d.box(&class="tok-comment">#39;upper_carriage39;, w=carriage_w, d=carriage_d, h=h-t+2), y=-d/2, z=0)
s3d.material(plate, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#d8d9d539;)
s3d.material(mount, &class="tok-comment">#39;aluminiumclass="tok-string">39;, color=39;#aeb5b639;)
return s3d.group(&class="tok-comment">#39;upper_shelf_group39;, plate, mount)
def positive_handle(w=63, d=40, h=120, t=18):
solid = s3d.extrude(&class="tok-comment">#39;handle39;, s3d.rect(w=t, d=d, r=6), h=h)
solid = s3d.at(solid, x=(w-t)/2)
hub = s3d.at(s3d.box(&class="tok-comment">#39;handle_neck39;, w=w, d=d, h=t), z=h-t)
s3d.join(solid, hub)
s3d.material(solid, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#747e8039;)
return s3d.group(&class="tok-comment">#39;positive_handle_group39;, solid)
def negative_handle(w=64, d=40, h=119, t=18):
solid = s3d.at(s3d.extrude(&class="tok-comment">#39;handle39;, s3d.rect(w=t, d=d, r=6), h=h), x=-(w-t)/2)
hub = s3d.at(s3d.box(&class="tok-comment">#39;handle_neck39;, w=w, d=d, h=t), z=h-t)
s3d.join(solid, hub)
s3d.material(solid, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#747e8039;)
return s3d.group(&class="tok-comment">#39;negative_handle_group39;, solid)
def lower_tray(w=443, d=430, h=151, r=14, rim=7):
solid = s3d.at(s3d.extrude(&class="tok-comment">#39;tray39;, s3d.rect(w=w, d=d, r=r), h=h), y=15)
s3d.pocket(solid, s3d.rect(w=w-2*rim, d=d-2*rim, r=r/2), depth=rim, on=solid.face(&class="tok-comment">#39;top39;))
mount = s3d.at(s3d.box(&class="tok-comment">#39;lower_carriage39;, w=106, d=35, h=100), y=-d/2)
s3d.material(solid, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#b9bfbd39;)
s3d.material(mount, &class="tok-comment">#39;aluminiumclass="tok-string">39;, color=39;#aeb5b639;)
return s3d.group(&class="tok-comment">#39;lower_tray_group39;, solid, mount)