import sand3d as s3d
def suspended_monitor():
post = s3d.at(leg_01(), z=1121)
arm = s3d.at(arm_01(), y=-225.5, z=979)
s3d.joint(&class="tok-comment">#39;joint_arm_01_joint_00class="tok-string">39;, arm, on=s3d.local(post, x=0, y=0, z=0), kind=39;revoluteclass="tok-string">39;, axis=39;+Z39;, range=(0,179))
return s3d.assembly(&class="tok-comment">#39;suspended_monitor39;, post, arm)
def leg_01(h=403, shaft_d=70, sleeve_d=91, cap_d=124, sleeve_z=184, cap_z=387, cap_h=16):
shaft = s3d.cylinder(&class="tok-comment">#39;shaft39;, d=shaft_d, h=sleeve_z+2)
sleeve = s3d.at(s3d.cylinder(&class="tok-comment">#39;sleeve39;, d=sleeve_d, h=cap_z-sleeve_z+2), z=sleeve_z)
cap = s3d.at(s3d.cylinder(&class="tok-comment">#39;cap39;, d=cap_d, h=cap_h), z=cap_z)
solid = s3d.join(shaft, sleeve, cap)
s3d.material(solid, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#777b7e39;)
return s3d.group(&class="tok-comment">#39;leg_0139;, solid)
def arm_01(w=72, d=521, h=142, pin=70, rise=18, thick=102, slope=125, pivot_y=225.5):
outline = s3d.at(s3d.extrude(&class="tok-comment">#39;outline39;, s3d.slot(l=d,d=w), h=h), rz=90)
side = s3d.at(s3d.extrude(&class="tok-comment">#39;side39;, s3d.poly([(-rise,-d/2),(-rise,d/2),(-rise-thick,d/2),(-rise-thick,-d/2+slope),(-rise-thick+slope*0.36,-d/2)]), h=w, both=True), ry=90)
solid = s3d.intersect(outline, side)
collar = s3d.at(s3d.cylinder(&class="tok-comment">#39;pivot39;, d=pin, h=h-rise), y=pivot_y, z=rise)
outer = s3d.at(s3d.cylinder(&class="tok-comment">#39;outer_pivot39;, d=64, h=rise*2), y=-pivot_y)
solid = s3d.join(solid,collar,outer)
s3d.material(solid, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#777b7e39;)
child = s3d.at(arm_02(), z=-164)
part = s3d.group(&class="tok-comment">#39;arm_0139;,solid,child)
s3d.joint(&class="tok-comment">#39;joint_arm_02_joint_00class="tok-string">39;, child, on=s3d.local(part, x=0, y=-225.5, z=0), kind=39;revoluteclass="tok-string">39;, axis=39;+Z39;, range=(0,179))
return part
def arm_02(w=72, d=521, h=164, pin=70, bottom=52, thick=102, slope=125, pivot_y=225.5):
outline = s3d.at(s3d.extrude(&class="tok-comment">#39;outline39;, s3d.slot(l=d,d=w), h=h), rz=90)
side = s3d.at(s3d.extrude(&class="tok-comment">#39;side39;, s3d.poly([(-bottom-slope*0.376,-d/2),(-bottom,-d/2+slope),(-bottom,d/2),(-bottom-thick,d/2),(-bottom-thick,-d/2)]), h=w, both=True), ry=90)
solid = s3d.intersect(outline,side)
collar = s3d.at(s3d.cylinder(&class="tok-comment">#39;pivot39;, d=pin, h=h-10), y=pivot_y)
outer = s3d.at(s3d.cylinder(&class="tok-comment">#39;outer_pivot39;, d=64, h=h-bottom), y=-pivot_y, z=bottom)
solid = s3d.join(solid,collar,outer)
s3d.material(solid, &class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#777b7e39;)
child = s3d.at(monitor_01(), y=pivot_y, z=-780)
part = s3d.group(&class="tok-comment">#39;arm_0239;,solid,child)
s3d.joint(&class="tok-comment">#39;joint_monitor_01_joint_00class="tok-string">39;, child, on=s3d.local(part, x=0, y=225.5, z=0), kind=39;revoluteclass="tok-string">39;, axis=39;+Z39;, range=(0,179))
return part
def monitor_01(panel_half=489, front=10, back=-72, end=-9, panel_z=109, panel_h=549, rail_back=-76, frame_x=52, frame_y=581, rail_t=8, rail_h=37, rail_z=257, rail_gap=219, wire_d=17, upright_d=25, upright_z=270, upright_h=310, cross_w=80, cross_d=392, cross_z=708, cross_h=36, stem_d=56, h=780, link_y=134):
profile = s3d.poly([(front,-panel_half),(front,panel_half),(end,panel_half),s3d.spline([(end,panel_half),(back,0),(end,-panel_half)] )])
panel = s3d.at(s3d.extrude(&class="tok-comment">#39;panel39;,profile,h=panel_h),z=panel_z)
path = s3d.spline([(frame_x,-frame_y),(end,-panel_half),(rail_back,0),(end,panel_half),(frame_x,frame_y)])
rail = s3d.at(s3d.extrude(&class="tok-comment">#39;back_rail39;,s3d.stroke(path,t=rail_t),h=rail_h),z=rail_z)
rail2 = s3d.at(s3d.copy(rail),z=rail_z+rail_gap)
lower = s3d.wire(&class="tok-comment">#39;lower_frame39;,[(frame_x,-frame_y,upright_z),(frame_x,-frame_y,wire_d/2),(frame_x,frame_y,wire_d/2),(frame_x,frame_y,upright_z)],d=wire_d,fillet=100)
post = s3d.at(s3d.cylinder(&class="tok-comment">#39;frame_upright39;,d=upright_d,h=upright_h),x=frame_x,y=frame_y,z=upright_z)
post2 = s3d.at(s3d.copy(post),y=-frame_y)
link = s3d.at(s3d.wire(&class="tok-comment">#39;lower_link39;,[(back,0,panel_z+40),(back,0,wire_d/2),(frame_x,0,wire_d/2)],d=6,fillet=30),y=link_y)
link2 = s3d.at(s3d.copy(link),y=-link_y)
cross = s3d.at(s3d.extrude(&class="tok-comment">#39;crosspiece39;,s3d.rect(w=cross_w,d=cross_d,r=12),h=cross_h),z=cross_z)
stem = s3d.at(s3d.cylinder(&class="tok-comment">#39;stem39;,d=stem_d,h=h-cross_z-cross_h+1),z=cross_z+cross_h-1)
bracket = s3d.at(s3d.box(&class="tok-comment">#39;bracket39;,w=20,d=cross_d/2,h=cross_z-panel_z-panel_h+2),x=back+10,z=panel_z+panel_h-1)
s3d.material(panel,&class="tok-comment">#39;plasticclass="tok-string">39;,color=39;#30343839;)
for item in [rail,rail2,lower,post,post2,link,link2,cross,stem,bracket]:
s3d.material(item,&class="tok-comment">#39;painted_metalclass="tok-string">39;,color=39;#777b7e39;)
return s3d.group(&class="tok-comment">#39;monitor_0139;,panel,rail,rail2,lower,post,post2,link,link2,cross,stem,bracket)