import sand3d as s3d
def emergency_shower():
body = s3d.at(shower_body(), x=445.5, y=118, z=0)
return s3d.assembly(class="tok-string">"emergency_shower", body)
def shower_body(px=24.5, py=-325, pipe=33, top=2300, reach=756, bend=100, head_d=270, head_z=2027, head_h=53, bowl_d=209, bowl_y=278, bowl_z=996, bowl_h=40, mount_y=238, mount_d=145, foot_d=230, support_z=774, rail_z=843, rail_w=151, nozzle=65):
upright = s3d.wire(class="tok-string">"upright", path=[(px,py,20),(px,py,top),(px,py+reach,top),(px,py+reach,head_z+head_h)], d=pipe, fillet=bend)
foot = s3d.cone(class="tok-string">"foot", d=foot_d, d2=pipe, h=45)
foot = s3d.at(foot, x=px, y=py)
head = s3d.shell(s3d.dome(class="tok-string">"shower_head", d=head_d, h=head_h), t=3, open=class="tok-string">"bottom")
head = s3d.at(head, x=px, y=py+reach, z=head_z)
neck = s3d.at(s3d.cone(class="tok-string">"head_neck", d=80, d2=pipe, h=65), x=px, y=py+reach, z=head_z+head_h-3)
bowl = s3d.shell(s3d.dome(class="tok-string">"eyewash_dish", d=bowl_d, h=bowl_h), t=3, open=class="tok-string">"bottom")
bowl = s3d.at(bowl, x=px, y=py+bowl_y, z=bowl_z, rx=180)
support = s3d.wire(class="tok-string">"dish_support", path=[(px,py,support_z),(px,py+bowl_y,support_z),(px,py+bowl_y,bowl_z-bowl_h+3)], d=pipe, fillet=45)
rail = s3d.wire(class="tok-string">"guard_loop", path=[(px,py,rail_z),(px-rail_w,py,rail_z),(px-rail_w,py+bowl_y,rail_z),(px,py+bowl_y,rail_z)], d=20, fillet=40)
solids = [upright, foot, head, neck, bowl, support, rail]
for level in (131,1121):
bracket = s3d.at(s3d.cylinder(class="tok-string">"wall_arm", d=31, h=mount_y), x=px, y=py, z=level, rx=90)
plate = s3d.at(s3d.cylinder(class="tok-string">"wall_plate", d=mount_d, h=8), x=px, y=py-mount_y, z=level, rx=90)
solids.extend([bracket,plate])
for side in (-1,1):
outlet = s3d.wire(class="tok-string">"eyewash_outlet", path=[(px+side*nozzle,py+bowl_y,bowl_z-15),(px+side*nozzle,py+bowl_y,bowl_z+64),(px+side*(nozzle-25),py+bowl_y,bowl_z+64)], d=22, fillet=15)
solids.append(outlet)
for solid in solids:
s3d.material(solid, kind=class="tok-string">"steel", color=class="tok-string">"class="tok-comment">#929b9c")
cover_a = s3d.at(outlet_cover_one(), x=411.5-445.5, y=72-118, z=1051)
cover_b = s3d.at(outlet_cover_two(), x=528-445.5, y=72-118, z=1051)
lever = s3d.at(overhead_lever(), x=413-445.5, y=51-118, z=2285)
paddle = s3d.at(eyewash_paddle(), x=263.5-445.5, y=-114-118, z=834)
root = s3d.group(class="tok-string">"shower_body", solids, cover_a, cover_b, lever, paddle)
s3d.joint(class="tok-string">"joint_lid_01_joint_00", cover_a, s3d.local(root,x=-55,y=-46,z=1066), kind=class="tok-string">"revolute", axis=class="tok-string">"+Y", range=(-179,0))
s3d.joint(class="tok-string">"joint_lid_02_joint_00", cover_b, s3d.local(root,x=104.5,y=-46,z=1066), kind=class="tok-string">"revolute", axis=class="tok-string">"+Y", range=(0,179))
s3d.joint(class="tok-string">"joint_handleSmall_01_joint_00", lever, s3d.local(root,x=-5.5,y=-134,z=2300), kind=class="tok-string">"continuous", axis=class="tok-string">"-X")
s3d.joint(class="tok-string">"joint_handle_01_joint_00", paddle, s3d.local(root,x=-151.5,y=-226,z=843), kind=class="tok-string">"revolute", axis=class="tok-string">"-X", range=(-90,0))
return root
def outlet_cover_one(w=49,d=42,h=18):
cap = s3d.dome(class="tok-string">"cover", d=d, h=h/2)
cap = s3d.scale(cap, s=(w/d,1,1))
s3d.material(cap, kind=class="tok-string">"plastic", color=class="tok-string">"class="tok-comment">#36764b")
return s3d.group(class="tok-string">"outlet_cover_one",cap)
def overhead_lever(w=60,d=170,h=30,t=6,pin=10):
path = s3d.spline([(w/2-t/2,-d/2),(w/2-t/2,-d/3),(-w/4,0),(-w/4,d/2)], tangents=((0,1),(0,1)))
bar = s3d.extrude(class="tok-string">"lever",s3d.stroke(path,t=t),h=h)
axle = s3d.at(s3d.cylinder(class="tok-string">"lever_pin",d=pin,h=w),x=-w/2,y=d/2-h/2,z=h/2,ry=90)
s3d.material(bar,kind=class="tok-string">"steel",color=class="tok-string">"class="tok-comment">#929b9c")
s3d.material(axle,kind=class="tok-string">"steel",color=class="tok-string">"class="tok-comment">#929b9c")
grip = s3d.at(pull_grip(), x=-15,y=70,z=-595)
lever = s3d.group(class="tok-string">"overhead_lever",bar,axle,grip)
s3d.joint(class="tok-string">"joint_handleBig_01_joint_00",grip,s3d.local(lever,x=-15,y=70,z=15),kind=class="tok-string">"continuous",axis=class="tok-string">"-X")
return lever
def pull_grip(w=20,d=178,h=622,grip_h=155,rod_d=14,grip_d=11):
rod = s3d.wire(class="tok-string">"pull_rod", path=[(0,0,grip_h),(0,0,h)],d=rod_d)
triangle = s3d.wire(class="tok-string">"triangle_grip",path=[(0,0,grip_h),(0,-d/2,grip_d),(0,d/2,grip_d),(0,0,grip_h)],d=grip_d,fillet=20)
s3d.material(rod,kind=class="tok-string">"steel",color=class="tok-string">"class="tok-comment">#929b9c")
s3d.material(triangle,kind=class="tok-string">"steel",color=class="tok-string">"class="tok-comment">#929b9c")
return s3d.group(class="tok-string">"pull_grip",rod,triangle)
def outlet_cover_two(w=48,d=42,h=18):
cap = s3d.dome(class="tok-string">"cover",d=d,h=h/2)
cap = s3d.scale(cap,s=(w/d,1,1))
s3d.material(cap,kind=class="tok-string">"plastic",color=class="tok-string">"class="tok-comment">#36764b")
return s3d.group(class="tok-string">"outlet_cover_two",cap)
def eyewash_paddle(w=75,d=30,h=111,t=3):
tab = s3d.box(class="tok-string">"paddle",w,t,h)
tab = s3d.at(tab,y=-d/2+t/2)
hub = s3d.at(s3d.cylinder(class="tok-string">"paddle_hub",d=d,h=12),x=w/2-9,z=9,ry=90)
s3d.material(tab,kind=class="tok-string">"painted_metal",color=class="tok-string">"class="tok-comment">#366747")
s3d.material(hub,kind=class="tok-string">"steel",color=class="tok-string">"class="tok-comment">#929b9c")
return s3d.group(class="tok-string">"eyewash_paddle",tab,hub)