import sand3d as s3d
def locker():
root = s3d.at(cabinet_stand(), y=-3)
a = s3d.at(upper_door_one(), x=-160, y=-81, z=1262)
b = s3d.at(upper_door_two(), x=160, y=-81, z=1262)
c = s3d.at(lower_door_one(), x=-160, y=-81, z=470)
d = s3d.at(lower_door_two(), x=160, y=-81, z=470)
s3d.joint(&class="tok-comment">#39;joint_sm_door1_b01_joint_00class="tok-string">39;, a, s3d.local(root, x=-30, y=-50, z=1657), axis=39;+Z39;, range=(0,90))
s3d.joint(&class="tok-comment">#39;joint_sm_door2_b01_joint_00class="tok-string">39;, b, s3d.local(root, x=290, y=-82, z=1657), axis=39;+Z39;, range=(0,90))
s3d.joint(&class="tok-comment">#39;joint_sm_door3_b01_joint_00class="tok-string">39;, c, s3d.local(root, x=-30, y=-82, z=865), axis=39;+Z39;, range=(0,90))
s3d.joint(&class="tok-comment">#39;joint_sm_door4_b01_joint_00class="tok-string">39;, d, s3d.local(root, x=290, y=-82, z=865), axis=39;+Z39;, range=(0,90))
return s3d.assembly(&class="tok-comment">#39;locker39;, root, a, b, c, d)
def cabinet_stand(w=640, depth=500, top=2090, bottom=390, cy=165, t=10, leg=30, leg_x=297, leg_y=394, rail_z=346, rail_h=44, slat_w=644, slat_d=72, slat_h=33, slat_y=-379, pitch=124):
outer = s3d.at(s3d.box(&class="tok-comment">#39;cabinet39;, w=w, d=depth, h=top-bottom), y=cy, z=bottom)
outer = s3d.shell(outer, t=t, open=&class="tok-comment">#39;-Y39;)
stile = s3d.at(s3d.box(&class="tok-comment">#39;center_stile39;, w=6*t, d=t, h=top-bottom), y=cy-depth/2+t/2, z=bottom)
divider = s3d.at(s3d.box(&class="tok-comment">#39;divider39;, w=t, d=depth-t, h=top-bottom-t), y=cy, z=bottom)
edge = s3d.at(s3d.box(&class="tok-comment">#39;edge_stile39;, w=3*t, d=t, h=top-bottom), x=(w-3*t)/2, y=cy-depth/2+t/2, z=bottom)
twin = s3d.transform(s3d.copy(edge), mirror=&class="tok-comment">#39;x39;)
sill = s3d.at(s3d.box(&class="tok-comment">#39;sill39;, w=w-t, d=t, h=80), y=cy-depth/2+t/2, z=bottom)
lintel = s3d.at(s3d.box(&class="tok-comment">#39;lintel39;, w=w-t, d=t, h=38), y=cy-depth/2+t/2, z=top-38)
shelf = s3d.at(s3d.box(&class="tok-comment">#39;shelf39;, w=w-t, d=depth-t, h=t), y=cy, z=1260-t/2)
s3d.join(outer, stile, divider, edge, twin, sill, lintel, shelf)
legs = s3d.at(s3d.box(&class="tok-comment">#39;leg39;, w=leg, d=leg, h=rail_z+rail_h/2), on=s3d.grid(nx=2, ny=2, px=2*leg_x, py=2*leg_y))
rails = s3d.at(s3d.box(&class="tok-comment">#39;side_rail39;, w=leg, d=2*leg_y+leg, h=rail_h), on=s3d.grid(nx=2, px=2*leg_x), z=rail_z)
cross = s3d.at(s3d.box(&class="tok-comment">#39;cross_rail39;, w=2*leg_x+leg, d=leg, h=rail_h), on=s3d.grid(nx=1, ny=2, py=2*leg_y), z=rail_z)
slats = s3d.at(s3d.box(&class="tok-comment">#39;slat39;, w=slat_w, d=slat_d, h=slat_h), on=s3d.grid(nx=1, ny=3, py=pitch), y=slat_y+pitch, z=rail_z+rail_h-1)
s3d.join(outer, rails, cross, legs, slats)
part = s3d.group(&class="tok-comment">#39;cabinet_stand39;, outer)
s3d.material(part, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#85898439;)
return part
def upper_door_one(w=260, d=18, h=790):
solid = s3d.box(&class="tok-comment">#39;door39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#85898439;)
lock = s3d.at(upper_lock_one(), x=-97, y=-13, z=364)
s3d.joint(&class="tok-comment">#39;joint_sm_lock1_b01_joint_00class="tok-string">39;, lock, s3d.local(solid, x=-97, y=-15, z=388), axis=39;+Y39;, range=(0,90))
return s3d.group(&class="tok-comment">#39;upper_door_one39;, solid, lock)
def upper_lock_one(w=32, d=12, h=50):
solid = s3d.box(&class="tok-comment">#39;lock39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#aaaead39;)
return s3d.group(&class="tok-comment">#39;upper_lock_one39;, solid)
def upper_door_two(w=260, d=18, h=790):
solid = s3d.box(&class="tok-comment">#39;door39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#85898439;)
lock = s3d.at(upper_lock_two(), x=-97, y=-13, z=364)
s3d.joint(&class="tok-comment">#39;joint_sm_lock2_b01_joint_00class="tok-string">39;, lock, s3d.local(solid, x=-97, y=-15, z=388), axis=39;+Y39;, range=(0,90))
return s3d.group(&class="tok-comment">#39;upper_door_two39;, solid, lock)
def upper_lock_two(w=32, d=12, h=50):
solid = s3d.box(&class="tok-comment">#39;lock39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#aaaead39;)
return s3d.group(&class="tok-comment">#39;upper_lock_two39;, solid)
def lower_door_one(w=260, d=18, h=790):
solid = s3d.box(&class="tok-comment">#39;door39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#85898439;)
lock = s3d.at(lower_lock_one(), x=-97, y=-13, z=365)
s3d.joint(&class="tok-comment">#39;joint_sm_lock3_b01_joint_00class="tok-string">39;, lock, s3d.local(solid, x=-97, y=-15, z=388), axis=39;+Y39;, range=(0,90))
return s3d.group(&class="tok-comment">#39;lower_door_one39;, solid, lock)
def lower_lock_one(w=32, d=12, h=50):
solid = s3d.box(&class="tok-comment">#39;lock39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#aaaead39;)
return s3d.group(&class="tok-comment">#39;lower_lock_one39;, solid)
def lower_door_two(w=260, d=18, h=790):
solid = s3d.box(&class="tok-comment">#39;door39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;painted_metalclass="tok-string">39;, color=39;#85898439;)
lock = s3d.at(lower_lock_two(), x=-97, y=-13, z=365)
s3d.joint(&class="tok-comment">#39;joint_sm_lock4_b01_joint_00class="tok-string">39;, lock, s3d.local(solid, x=-97, y=-15, z=388), axis=39;+Y39;, range=(0,90))
return s3d.group(&class="tok-comment">#39;lower_door_two39;, solid, lock)
def lower_lock_two(w=32, d=12, h=50):
solid = s3d.box(&class="tok-comment">#39;lock39;, w=w, d=d, h=h)
s3d.material(solid, kind=&class="tok-comment">#39;chromeclass="tok-string">39;, color=39;#aaaead39;)
return s3d.group(&class="tok-comment">#39;lower_lock_two39;, solid)