import sand3d as s3d
def sheet_stack():
base = s3d.at(bottom_sheet(), x=-30, y=32, z=0)
lower = s3d.at(lower_sheet(), x=-31, y=32, z=9)
middle = s3d.at(middle_sheet(), x=-30, y=32, z=18)
upper = s3d.at(upper_sheet(), x=-32, y=35, z=27)
top = s3d.at(top_sheet(), x=-34, y=44, z=36)
return s3d.assembly(&class="tok-comment">#39;sheet_stack39;, base, lower, middle, upper, top)
def bottom_sheet(w=256, d=206, t=10, lift=10):
ob = curled_layer(&class="tok-comment">#39;bottom39;, w=w, d=d, t=t, lift=lift)
return s3d.group(&class="tok-comment">#39;bottom_sheet39;, ob)
def curled_layer(name, w, d, t, lift):
p = s3d.poly([(d/2,0),(-d/2+t,0),(-d/2,t/2),(-d/2,t),(-d/2+t/2,lift),(-d/2+t*3,t),(-d/2+t*4,t),(0,t),(d/2,t)], fillet=t/8)
ob = s3d.extrude(name, p, h=w)
gap = s3d.poly([(-d/2+t/2,t*.65),(-d/2+t*3,t*.45),(-d/2+t*3,t*.7),(-d/2+t,t)], fillet=t/10)
ob = s3d.pocket(ob, gap, on=ob.face(&class="tok-comment">#39;top39;), depth=w)
ob = s3d.at(ob, x=-w/2, rx=90, rz=90)
s3d.material(ob, &class="tok-comment">#39;fabricclass="tok-string">39;, color=39;#e6e4df39;)
return ob
def lower_sheet(w=256, d=206, t=10, lift=11):
ob = curled_layer(&class="tok-comment">#39;lower39;, w=w, d=d, t=t, lift=lift)
return s3d.group(&class="tok-comment">#39;lower_sheet39;, ob)
def middle_sheet(w=257, d=206, t=10, lift=13):
ob = curled_layer(&class="tok-comment">#39;middle39;, w=w, d=d, t=t, lift=lift)
return s3d.group(&class="tok-comment">#39;middle_sheet39;, ob)
def upper_sheet(w=254, d=206, t=10, lift=15):
ob = curled_layer(&class="tok-comment">#39;upper39;, w=w, d=d, t=t, lift=lift)
return s3d.group(&class="tok-comment">#39;upper_sheet39;, ob)
def top_sheet(w=251, d=194, t=4, lift=18, lip=29, rise=3):
p = s3d.poly([(d/2,0),(-d/2+lip,0),(-d/2,t),(-d/2,lift),(-d/2+lip,t+2), (0,t),(d/2,t+rise)], fillet=t/4)
ob = s3d.extrude(&class="tok-comment">#39;top39;, p, h=w)
gap = s3d.poly([(-d/2+t,t+2),(-d/2+t,lift-t),(-d/2+lip-t,t+2)], fillet=t/4)
ob = s3d.pocket(ob, gap, on=ob.face(&class="tok-comment">#39;top39;), depth=w)
ob = s3d.at(ob, x=-w/2, rx=90, rz=90)
s3d.material(ob, &class="tok-comment">#39;fabricclass="tok-string">39;, color=39;#e6e4df39;)
return s3d.group(&class="tok-comment">#39;top_sheet39;, ob)