diff --git a/backpack-organization/main-box.scad b/backpack-organization/main-box.scad index 0b633c7..05acc38 100644 --- a/backpack-organization/main-box.scad +++ b/backpack-organization/main-box.scad @@ -6,15 +6,20 @@ $fn=128; outerWall=4; innerWall=2; layerClearance = 0.5; -verStr="v8"; +verStr="v9"; font="Montserrat"; +ep = 0.01; // smallest unit to ensure overlap between shapes // as a convention, outer dimensions refer to measurements from outside wall to // outside wall, as if you put a caliper around the whole thing. Inner // dimesions refers to inside or void dimensions: the space available to be // filled. +layer1H = 44; +layer2H = 40; + outerBoxLength = 300; outerBoxWidth = 154; +outerBoxHeight = layer1H + layer2H + 2*outerWall; innerBoxLength = outerBoxLength - 2*outerWall; innerBoxWidth = outerBoxWidth - 2*outerWall; @@ -25,8 +30,114 @@ audioTrayIS = audioTraySide - 2*innerWall; audioTrayIH = audioTrayHeight - innerWall; +module shellBottom(dims) { + lipClearance = innerWall + 1; + bottomShellH = dims[2]*0.75; + difference() { + union() { + difference() { + // main body + chamferedCube(dims, + chamfer=4); + + // top-cut (75% up) + translate([-outerWall, -outerWall, bottomShellH]) + cube([dims[0] + 2*outerWall, dims[1] + 2*outerWall, dims[2]]); + } + + // add lip to mate with top + translate([lipClearance, lipClearance, bottomShellH - ep]) + roundedCube( + [dims[0] - 2*lipClearance, dims[1] - 2*lipClearance, 4 - 1], + [2, 2, 0]); + } + + // carve out the interior + translate([outerWall, outerWall, outerWall]) + cube([dims[0] - 2*outerWall, dims[1] - 2*outerWall, dims[2]]); + + // carve out a 0.6mm sliver for the fabric to sit in + fabricClearance = 0.6; + translate([ + lipClearance - fabricClearance, + lipClearance - fabricClearance, + bottomShellH - 4]) + difference() { + roundedCube( + [ dims[0] - 2*lipClearance + 2*fabricClearance, + dims[1] - 2*lipClearance + 2*fabricClearance, + 7], + [2, 2, 0]); + + translate([fabricClearance, fabricClearance, -ep]) + roundedCube( + [dims[0] - 2*lipClearance, dims[1] - 2*lipClearance, 8], + [2, 2, 0]); + } + + // version marker + color("black") + translate([0.6, 20, 8]) rotate([90, 0,-90]) + linear_extrude(0.61) text(text = verStr, font = font, size = 8); + } +} + +module shellTop(dims) { + lipClearance = innerWall + 1; + topShellH = dims[2]*0.25; + difference() { + union() { + difference() { + // main body + chamferedCube(dims, + chamfer=4); + + // top-cut (75% up) + translate([-outerWall, -outerWall, topShellH + 4]) + cube([dims[0] + 2*outerWall, dims[1] + 2*outerWall, dims[2]]); + } + } + + // carve out the interior + translate([outerWall, outerWall, outerWall]) + cube([dims[0] - 2*outerWall, dims[1] - 2*outerWall, dims[2]]); + + // carve out the interior of the lip + translate([lipClearance, lipClearance, topShellH]) + roundedCube( + [dims[0] - 2*lipClearance, dims[1] - 2*lipClearance, dims[2]], + [2, 2, 0]); + + // carve out a 0.6mm sliver for the fabric to sit in + fabricClearance = 0.6; + translate([ + lipClearance, + lipClearance, + topShellH - 4]) + difference() { + roundedCube( + [ dims[0] - 2*lipClearance, + dims[1] - 2*lipClearance, + 7], + [2, 2, 0]); + + translate([fabricClearance, fabricClearance, -ep]) + roundedCube( + [ dims[0] - 2*lipClearance - 2*fabricClearance, + dims[1] - 2*lipClearance - 2*fabricClearance, + 8], + [2, 2, 0]); + } + + // version marker + color("black") + translate([0.6, 20, 8]) rotate([90, 0,-90]) + linear_extrude(0.61) text(text = verStr, font = font, size = 8); + } +} + module layer1() { - oH = 44; + oH = layer1H; oL = innerBoxLength - 2*layerClearance; // outer length oW = innerBoxWidth - 2*layerClearance; // outer width iL = oL - 2*innerWall; // inner length @@ -66,7 +177,7 @@ module layer1() { // plain cube version (we're going to oversize and chamfer to get // diagonal edges) // translate([(handleDia - bitW) / 2, handleDia / 2, 0]) cube([bitW, bitL + handleDia/2, oH]); - translate([(handleDia - bitW) / 2 - 5, handleDia / 2 - 5, -0.01]) + translate([(handleDia - bitW) / 2 - 5, handleDia / 2 - 5, -ep]) chamferedCube([bitW + 10, bitL + handleDia/2 + 10, 16], chamfer=5); // power block cutout @@ -139,7 +250,7 @@ module layer1() { } module layer2() { - oH = 40; + oH = layer2H; oL = innerBoxLength - 2*layerClearance; // outer length oW = innerBoxWidth - 2*layerClearance; // outer width iL = oL - 2*innerWall; // inner length @@ -159,21 +270,21 @@ module layer2() { // Tekton tool kit translate([2, 103 + innerWall, 0]) - cube([105.5, 57, oH]); + cube([105.5, 61, oH]); // Slice knife translate([114, 103 + innerWall, 0]) - cube([22.5, 153, oH]); + cube([22.5, 156, oH]); // cables - translate([56, 224, 0]) + translate([56, 226, 0]) cylinder(d=110, h=oH); // fingerways translate([30, 80, 0]) cube([36, 30, oH]); - translate([105, 126, 0]) + translate([105, 130, 0]) cube([12, 36, oH]); } @@ -185,7 +296,7 @@ module layer2() { translate([32, 96, 0]) scale([6, 22, 1]) cylinder(d=1, h=oH); translate([68, 96, 0]) scale([6, 22, 1]) cylinder(d=1, h=oH); - translate([112.75, 128, 0]) scale([6.5, 6, 1]) cylinder(d=1, h=oH); + translate([112.75, 132, 0]) scale([6.5, 6, 1]) cylinder(d=1, h=oH); } } @@ -426,9 +537,19 @@ module usbBitsTray() { } } -layer1(); -//layer2(); -//translate([outerBoxWidth + 10, 0, 0]) audioJackTray(); -//translate([outerBoxWidth + 10, 80, 0]) usbBitsTray(); -//translate([outerBoxWidth + 10, 160, 0]) headphoneAmpTray(); -//translate([outerBoxWidth + 10, 240, 0]) drumKeyTray(); +standoffX = outerBoxWidth + 10; +standoffY = outerBoxLength + 10; + +// test-print the lip +shellBottom([20, 30, 30]); +translate([24, 0, 0]) shellTop([20, 30, 30]); +/* +shellBottom([outerBoxWidth, outerBoxLength, outerBoxHeight]); +translate([0, standoffY, 0]) shellTop([outerBoxWidth, outerBoxLength, outerBoxHeight]); +translate([standoffX, 0, 0]) layer1(); +translate([standoffX, standoffY, 0]) layer2(); +translate([2*standoffX, 0, 0]) audioJackTray(); +translate([2*standoffX, 80, 0]) usbBitsTray(); +translate([2*standoffX, 160, 0]) headphoneAmpTray(); +translate([2*standoffX, 240, 0]) drumKeyTray(); +*/