3d/Box_Generator.scad

35 lines
869 B
OpenSCAD

INNER_X=20;
INNER_Y=40;
INNER_Z_BOTTOM=60;
INNER_Z_TOP=10;
INNER_Z_OVERLAP=10;
WALLSIZE=4;
// The main box
difference() {
cube([INNER_X+WALLSIZE*2, INNER_Y+WALLSIZE*2, INNER_Z_BOTTOM+WALLSIZE]);
translate([WALLSIZE, WALLSIZE, WALLSIZE]) {
cube([INNER_X, INNER_Y, INNER_Z_BOTTOM]);
}
}
// Overlap area
difference() {
translate([WALLSIZE/2, WALLSIZE/2, INNER_Z_BOTTOM+WALLSIZE])
cube([INNER_X+WALLSIZE, INNER_Y+WALLSIZE, INNER_Z_OVERLAP]);
translate([WALLSIZE, WALLSIZE, INNER_Z_BOTTOM+WALLSIZE])
cube([INNER_X, INNER_Y, INNER_Z_OVERLAP]);
}
// The top
translate([INNER_X + WALLSIZE * 4, 0, 0]) {
difference() {
cube([INNER_X+WALLSIZE*2, INNER_Y+WALLSIZE*2, INNER_Z_TOP+WALLSIZE]);
translate([WALLSIZE/2, WALLSIZE/2, WALLSIZE])
cube([INNER_X+WALLSIZE, INNER_Y+WALLSIZE, INNER_Z_TOP]);
}
}