// allviews top bottom testtop testbottom1 testbottom2 testplate // viewsopts no-fan // testviews assemblage include bottom_thick=5; top_thick=5; slot_width=7.92-0.8; slot_dist=36.62+1.4; hole_ray=4; len=40; slot_thick=3; module holes(){ start=slot_dist+slot_width/2; for (i=[0,1]){ translate([start+i*(slot_dist+slot_width),len/2,-1]) cylinder(r=hole_ray,h=2+bottom_thick+slot_thick,$fn=40); } } module top(){ difference(){ union(){ width=2*slot_width+3*slot_dist; cube([width,len,top_thick]); edge_len=8; edge_thick=0.8; translate([0,edge_len,top_thick]) cube([width,len-edge_len,edge_thick]); } holes(); } } module bottom(){ difference(){ union(){ cube([2*slot_width+3*slot_dist,len,bottom_thick]); for (i=[0,1]){ translate([slot_dist+i*(slot_dist+slot_width) ,0,bottom_thick]) difference(){ cube([slot_width,len,slot_thick]); translate([-1,len/2-hole_ray,-1]) cube([slot_width+2,hole_ray*2,slot_thick+2]); } } } union(){ holes(); } } } module main_view(view){ if (view=="top"){ top(); }else if (view=="bottom"){ bottom(); }else if (view=="testtop"){ testtop(); }else if (view=="testbottom1"){ intersection(){ translate([slot_dist/2+slot_width+5,0,0]) cube([slot_dist/2,len,3]); translate([0,0,-bottom_thick+1]) bottom(); } }else if (view=="testbottom2"){ intersection(){ translate([slot_dist/2+slot_width,0,0]) cube([slot_dist*2,len,3]); translate([0,0,-bottom_thick+1]) bottom(); } }else if (view=="testplate"){ cube([100,50,1]); }else if (view=="assemblage"){ rotate([180,0,0]) bottom(); translate([0,0,20]) rotate([180,0,0]) top(); } }