From ColdSphinX, 7 Years ago, written in AutoCAD/IntelliCAD Lisp.
Embed
  1. box_length=230;
  2. box_width=155;
  3. box_height=34.25;
  4. xboxes=5;
  5. yboxes=2;
  6. wall_thickness=3;
  7. lid_thickness=2;
  8.  
  9. module pocket(x=0,y=0){
  10.   pocket_length=((box_length-((xboxes+1)*wall_thickness))/xboxes);
  11.   //echo("pocket_length:",pocket_length);
  12.   pocket_width=((box_width-((yboxes+1)*wall_thickness))/yboxes);
  13.   //echo("pocket_width:",pocket_width);
  14.   pocket_height=(box_height-wall_thickness-lid_thickness);
  15.   //echo("pocket_height:",pocket_height);
  16.   translate([(wall_thickness+(x*(pocket_length+wall_thickness))),(wall_thickness+(y*(pocket_width+wall_thickness))),wall_thickness])
  17.     cube([pocket_length,pocket_width,pocket_height]);
  18. }
  19.  
  20. module lid(){
  21.   translate([wall_thickness,wall_thickness,(box_height-wall_thickness)])
  22.     cube([(box_length-wall_thickness),(box_width-(2*wall_thickness)),wall_thickness],false);
  23.   translate([(wall_thickness/2),(wall_thickness/2),(box_height-lid_thickness-wall_thickness)])
  24.     cube([(box_length-(wall_thickness/2)),(box_width-wall_thickness),wall_thickness],false);
  25. }
  26.  
  27. module stacking_phase() {
  28.   difference() {
  29.     cube([box_length,box_width,(wall_thickness/2)],false);
  30.     translate([(wall_thickness+1),(wall_thickness+1),0])
  31.       cube([(box_length-(wall_thickness/2)-1),(box_width-(2*wall_thickness)-2),(wall_thickness/2)],false);
  32.   }
  33. }
  34.  
  35. difference() {
  36.   color("grey")
  37.   cube([box_length,box_width,box_height],false);
  38.   union(){
  39.     color("red")
  40.     lid();
  41.     color("orange")
  42.     stacking_phase();
  43.     for(x = [0:xboxes])
  44.       for(y = [0:yboxes])
  45.         pocket(x,y);
  46.   }  
  47. }
  48.