box_width=155;
box_width=155;
box_height=34.
xboxes=5;
yboxes=2;
wall_thickness=3;
lid_thickness=2;
xboxes=5;
yboxes=2;
wall_thickness=3;
lid_thickness=2;
module
pocket_length=((box_length-((xboxes+1)*wall_thickness))/xboxes);
//echo("pocket_length:",pocket_length);
pocket_width=((box_width-((yboxes+1)*wall_thickness))/yboxes);
//echo("pocket_width:",pocket_width);
pocket_height=(box_height-wall_thickness-lid_thickness);
//echo("pocket_height:",pocket_height);
translate([(wall_thickness+(x*(pocket_length+wall_thickness))),(wall_thickness+(y*(pocket_width+wall_thickness))),wall_thickness])
cube([pocket_length,pocket_width,pocket_height]);
}
pocket_length=((box_length-((xboxes+1)*wall_thickness))/xboxes);
//echo("pocket_length:",pocket_length);
pocket_width=((box_width-((yboxes+1)*wall_thickness))/yboxes);
//echo("pocket_width:",pocket_width);
pocket_height=(box_height-wall_thickness-lid_thickness);
//echo("pocket_height:",pocket_height);
translate([(wall_thickness+(x*(pocket_length+wall_thickness))),(wall_thickness+(y*(pocket_width+wall_thickness))),wall_thickness])
cube([pocket_length,pocket_width,pocket_height]);
}
module stacking_form(phase_index=1)
polyhedron(points =
[box_length,wall_thickness,0], // 0 left down
[box_length,(box_width-wall_thickness),0], // 1 right down
[wall_thickness,(box_width-wall_thickness),0], // 2 right down
[wall_thickness,wall_thickness,0], // 3 left down
[box_length,0,(wall_thickness*phase_index)], // 4 left up
[box_length,box_width,(wall_thickness*phase_index)], // 5 right up
[0,box_width,(wall_thickness*phase_index)], // 6 right up
[0,0,(wall_thickness*phase_index)] // 7 left up
],faces =
[0,1,2,3], //
[4,5,1,0], //
[7,6,5,4], //
[5,6,2,1], //
[6,7,3,2], //
[7,4,0,3] //
]);
}
]);
}
module lid_nose(cut=0)
nose_length=((box_length/10)-cut);
nose_width=((wall_thickness-cut)/2);
nose_height=(1-(cut/2));
nose_length=((box_length/10)-cut);
nose_width=((wall_thickness-cut)/2);
nose_height=(1-(cut/2));
translate([(box_length-cut-(nose_width*1.
cube([nose_width,nose_length,nose_height+1]);
}
cube([nose_width,nose_length,nose_height+1]);
}
module
translate([0,box_width,0])
rotate([180,0,0])
opener_length=(box_length/5);
opener_width=(wall_thickness-cut)/4;
opener_height=(lid_thickness/2);
translate([(box_length-cut-opener_width),((box_width/2)-(opener_length/2)),(-lid_thickness)])
cube([opener_width,opener_length,opener_height]);
}
module lid_grab(cut=0) {
grab_length=(box_length/5);
grab_width=(lid_thickness*2);
grab_height=(lid_thickness/2);
translate([(box_length-(2*grab_width)),((box_width/2)-(grab_length/2)),0.1])
rotate([180,0,90])
polyhedron(points =
[0,0,0],
[grab_length,0,0],
[grab_length,grab_width,0],
[0,grab_width,0],
[0,(grab_width/2),grab_height],
[grab_length,(grab_width/2),grab_height]
],
faces=[
[0,1,2,3],
[5,4,3,2],
[0,4,5,1],
[0,3,4],
[5,2,1]
]);
//cube([grab_width,grab_length,grab_height]);
}
module lid_base(cut=0) {
translate([0,box_width,0])
rotate([180,0,0])
polyhedron(points = [
[(box_length-cut),wall_thickness,0], // 0 left down
[(box_length-cut),(box_width-wall_thickness-cut),0], // 1 right down
[wall_thickness,(box_width-wall_thickness-cut),0], // 2 right down
[wall_thickness,wall_thickness,0], // 3 left down
[(box_length-cut),(wall_thickness/2),lid_thickness], // 4 left up
[(box_length-cut),(box_width-(wall_thickness/2)-cut),lid_thickness],
[(box_length-cut),(box_width-(wall_thickness/2)-cut),lid_thickness], // 5 right up
[(wall_thickness/2),(box_width-(wall_thickness/2)-cut),lid_thickness],// 6 right up
[(wall_thickness/2),(wall_thickness/2),lid_thickness] // 7 left up
],faces =
[0,1,2,3], //
[4,5,1,0], //
[7,6,5,4], //
[5,6,2,1], //
[6,7,3,2], //
[7,4,0,3] //
]);
lid_nose(cut);
}
]);
lid_nose(cut);
}
module
translate([0,0,(box_height-wall_thickness)])
stacking_form(phase_index);
translate([0,0,(box_height-wall_thickness)])
lid();
}
if (cut > 0) {
difference() {
lid_base(cut);
lid_opener(cut);
lid_grab(cut);
}
} else {
lid_base(cut);
}
}
module top(phase_index=1){
translate([0,0,(box_height-wall_thickness)])
stacking_form(phase_index);
translate([0,0,(box_height-wall_thickness)])
lid();
}
module stacking_phase(phase_index=1)
difference()
cube([box_length,box_width,(wall_thickness*phase_index)],false);
stacking_form(phase_index);
}
}
cube([box_length,box_width,(wall_thickness*phase_index)],false);
stacking_form(phase_index);
}
}
/**/
difference()
color("grey")
cube([box_length,box_width,box_height],false);
union(){
color("red")
color("grey")
cube([box_length,box_width,box_height],false);
union(){
color("red")
top(1.
color("orange")
stacking_phase(1);
color("orange")
stacking_phase(1);
for(x =
for(y =
pocket(x,y);
}
}
translate([0,(-5),0])
rotate([180,0,0])
lid(1);
pocket(x,y);
}
}
/**/
translate([0,(-5),0])
rotate([180,0,0])
lid(1);
/**/