66 lines
2.1 KiB
OpenSCAD
66 lines
2.1 KiB
OpenSCAD
// measurements in inches
|
|
width = 40;
|
|
height = 99.5;
|
|
depth = 19.5;
|
|
|
|
cubeSize = 13.5;
|
|
|
|
shelfThickness = 0.5;
|
|
wallThickness = 1;
|
|
|
|
module shelvingUnit(includeFitTest = false) {
|
|
color("#242424") union() {
|
|
// sides
|
|
cube([wallThickness, depth, height]);
|
|
translate([width - wallThickness, 0, 0]) cube([wallThickness, depth, height]);
|
|
|
|
// top and bottom
|
|
cube([width, depth, wallThickness]);
|
|
translate([0, 0, height - wallThickness]) cube([width, depth, wallThickness]);
|
|
}
|
|
|
|
color("#384048") union() {
|
|
// shelves
|
|
for (i = [1 : floor((height - 2 * wallThickness) / (cubeSize + wallThickness))]) {
|
|
translate([wallThickness, 0, i*cubeSize + (i-1)*shelfThickness + wallThickness])
|
|
cube([width - 2 * wallThickness, depth, shelfThickness]);
|
|
}
|
|
|
|
// dividers
|
|
for (i = [1 : floor((width - 2 * wallThickness) / (cubeSize + wallThickness))]) {
|
|
translate([i * (cubeSize + wallThickness), 0, wallThickness])
|
|
cube([wallThickness, depth, height - 2 * wallThickness]);
|
|
}
|
|
}
|
|
|
|
if (includeFitTest) {
|
|
// test box fits
|
|
color("CornflowerBlue") union() {
|
|
// main boxes
|
|
translate([wallThickness, 0.01, wallThickness])
|
|
for (i = [0 : floor((height - 2 * wallThickness) / (cubeSize + wallThickness))])
|
|
for (j = [0 : floor((width - 2 * wallThickness) / (cubeSize + wallThickness)) - 1])
|
|
translate([j * (cubeSize + wallThickness), 0, i * (cubeSize + shelfThickness)])
|
|
cube([cubeSize, depth, cubeSize]);
|
|
|
|
// corner box
|
|
translate([30, 0.01, wallThickness])
|
|
for (i = [0 : floor((height - 2 * wallThickness) / (cubeSize + wallThickness))])
|
|
translate([0, 0, i * (cubeSize + shelfThickness)]) cube([9, depth, cubeSize]);
|
|
}
|
|
}
|
|
}
|
|
|
|
difference() {
|
|
shelvingUnit();
|
|
|
|
// cutout for corner box
|
|
union() {
|
|
translate([39, depth + 0.01, -1]) rotate([0, 0, 180]) difference() {
|
|
cube([9, depth - wallThickness, height + 2]);
|
|
translate([9, 0, -1]) rotate([0, 0, atan(9 / (depth - 2*wallThickness))]) cube([9, depth*2, height + 4]);
|
|
}
|
|
translate([width - wallThickness - 0.1, -0.1, -0.1]) cube([wallThickness + 0.2, depth + 0.2, height + 0.2]);
|
|
}
|
|
}
|