diff options
-rw-r--r-- | box/box.scad | 137 | ||||
-rw-r--r-- | box/outline.svg | 39 | ||||
-rw-r--r-- | box/simple_box.scad | 179 |
3 files changed, 338 insertions, 17 deletions
diff --git a/box/box.scad b/box/box.scad index 585668e..5c53432 100644 --- a/box/box.scad +++ b/box/box.scad @@ -58,12 +58,12 @@ pcbThickness = 1.6; //-- How much the PCB needs to be raised from the base //-- to leave room for solderings and whatnot -standoffHeight = 3.4; +standoffHeight = 3.9; //4.3; pinDiameter = 2.7; standoffDiameter = 6; //-- padding between pcb and inside wall -paddingFront = 0.1; +paddingFront = 49.4; paddingBack = 0.1; paddingRight = 0.1; paddingLeft = 0.1; @@ -101,7 +101,7 @@ cutoutsLid = [ // (5) = { yappRectangle | yappCircle } // (6) = { yappCenter } cutoutsFront = [ - [-3.67 * IN + origin_y - 9/2, 0, 9, 3.3, 0, yappRectangle] + //[-3.67 * IN + origin_y - 9/2, 0, 9, 3.3, 0, yappRectangle] ]; //-- back plane -- origin is pcb[0,0,0] @@ -123,7 +123,7 @@ cutoutsBack = [ // (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more) // (n) = { yappSymmetric } snapJoins = [ - [2, 5, yappLeft, yappRight, yappSymmetric] + [20, 5, yappLeft, yappRight, yappSymmetric] ]; //-- origin of labels is box [0,0,0] @@ -135,9 +135,8 @@ snapJoins = [ // (5) = size // (6) = "label text" labelsPlane = [ - [12, 35, 0, "lid", "Liberation Mono:style=bold", 4, "Square Dishy"], - [15, 30, 0, "lid", "Liberation Mono:style=bold", 4, "150W PoE++" ], - [15, 25, 0, "lid", "Liberation Mono:style=bold", 4, "50V DC" ], + [12, 35, 0, "lid", "Liberation Mono:style=bold", 4, "Square Dishy 150W PoE++"], + [35, 28, 0, "lid", "Liberation Mono:style=bold", 4, "50V DC" ], ]; // Reference board model @@ -149,31 +148,135 @@ translate([pcbX - origin_x, pcbY + origin_y, pcbZ - pcbThickness / 2]) onLidGap = 0; module lid_diagrams() { - translate([15, 18, -lidLabelDepth]) + translate([12, 27.5, -lidLabelDepth]) linear_extrude(basePlaneThickness) scale([0.15, 0.15, 1]) import("Polarity_marking_center_positive.svg"); +} + +module sl_plug() { + h1 = 36; + h2 = 3.5; + h3 = 11; + h4 = 55.5 - h3; + d1 = 12; + d2 = 10; + d3 = 3.3; + hull() { + cylinder(h=h1, d1=d1, d2=d2); + translate([0, 0, h1]) + cylinder(h=h2, d1=d2, d2=d3); + translate([0, 5, 0]) { + cylinder(h=h1, d1=d1, d2=d2); + translate([0, 0, h1]) + cylinder(h=h2, d1=d2, d2=d3); + } + } + hull() { + cylinder(h=h4, d=d3); + translate([0, 5, 0]) + cylinder(h=h4, d=d3); + } + translate([13, 15, -h3]) + rotate([0, 0, 90]) + linear_extrude(h3) + mirror([1, 0, 0]) + offset(0.2) + import("outline.svg"); +} - translate([shellLength - frontLabelDepth, 23.5, -12]) - rotate([90, 0, 90]) - linear_extrude(basePlaneThickness) - scale([0.075, 0.075, 1]) - import("plug.svg"); +module sl_shell() { + difference() { + hull() { + minkowski() { + sl_plug(); + sphere(r=2); + } + translate([15, 0, 0]) + minkowski() { + sl_plug(); + sphere(r=2); + } + } + sl_plug(); + translate([-25, -25, -60]) + cube(50); + translate([-25, -25, 39.8]) + cube(50); + hull() { + $fn=16; + translate([0, -0.35, 0]) + cylinder(h=50, d=3.5); + translate([0, 5.35, 0]) + cylinder(h=50, d=3.5); + } + hull() { + translate([7, -15, -4.5]) + rotate([90, 0, 45]) + cylinder(h=10, d=7); + translate([7, -15, -13]) + rotate([90, 0, 45]) + cylinder(h=10, d=7); + } + } } +module solidMinkowskiBox(L, W, H, rad, plane, wall) +{ + minkowski() { + cube([L+(wall*2)-(rad*2), + W+(wall*2)-(rad*2), + (H*2)+(plane*2)-(rad*2)], + center=true); + sphere(rad); + } +} + + difference() { - YAPPgenerate(); + union() { + YAPPgenerate(); + difference() { + translate([pcbX + 101, pcbY + origin_y - 3.67 * IN + 5/2, pcbZ + 3.3/2]) + rotate([180, 90, 0]) + sl_shell(); + difference() { + cube(400, center=true); + translate([(shellLength/2), shellWidth/2, (baseWallHeight) + basePlaneThickness]) { + $fn=25; + solidMinkowskiBox(shellInsideLength, shellInsideWidth, baseWallHeight, + roundRadius, basePlaneThickness, wallThickness); + } + } + translate([0, 0, (baseWallHeight+basePlaneThickness+ + lidWallHeight+lidPlaneThickness)]) + lidShell(); + } + } + + translate([pcbX + 101, pcbY + origin_y - 3.67 * IN + 5/2, pcbZ + 3.3/2]) + rotate([180, 90, 0]) + sl_plug(); if (printLidShell) { if (showSideBySide) { mirror([0,0,1]) mirror([0,1,0]) - translate([0, (5 + shellWidth+(shiftLid/2))*-2, 0]) - lid_diagrams(); + translate([0, (5 + shellWidth+(shiftLid/2))*-2, 0]) { + lid_diagrams(); + translate([0, 0, -(baseWallHeight+basePlaneThickness+ + lidWallHeight+lidPlaneThickness+onLidGap)]) + translate([pcbX + 101, pcbY + origin_y - 3.67 * IN + 5/2, pcbZ + 3.3/2]) + rotate([180, 90, 0]) + sl_plug(); + } } else { translate([0, 0, (baseWallHeight+basePlaneThickness+ lidWallHeight+lidPlaneThickness+onLidGap)]) - lid_diagrams(); + lid_diagrams(); + translate([pcbX + 101, pcbY + origin_y - 3.67 * IN + 5/2, pcbZ + 3.3/2]) + rotate([180, 90, 0]) + sl_plug(); } } }
\ No newline at end of file diff --git a/box/outline.svg b/box/outline.svg new file mode 100644 index 0000000..d92b86c --- /dev/null +++ b/box/outline.svg @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + width="36.329704mm" + height="19.66452mm" + viewBox="0 0 36.329704 19.66452" + version="1.1" + id="svg8"> + <defs + id="defs2" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + transform="translate(-2.2700427,-1.168005)"> + <g + id="g885" + transform="rotate(0.88356372,20.772726,11.169722)"> + <path + style="opacity:1;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.065;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 29.550904,1.0646023 -26.1830573,0.403141 -0.8716825,0.5715728 -0.315346,1.224312 6.5985523,11.1795929 0.502963,0.472039 0.5603807,0.153863 12.7091728,-0.13996 1.049498,0.236467 7.563396,5.466011 7.437659,-6.70687 L 31.070618,1.8789656 30.443793,1.3524909 Z" + id="path881" /> + </g> + </g> +</svg> diff --git a/box/simple_box.scad b/box/simple_box.scad new file mode 100644 index 0000000..585668e --- /dev/null +++ b/box/simple_box.scad @@ -0,0 +1,179 @@ + + +module RoundBox(length, width, height, radius) +{ + translate([0, radius, radius]) + { + minkowski() + { + cube([length / 2, width - 2 * radius, height - 2 * radius]); + rotate([0, 90, 0]) + cylinder(r=radius, h=length / 2, center=false); + } + } +} + +IN = 25.4; +origin_x = 3.85 * IN; +origin_y = 4.85 * IN; + +include <YAPPgenerator_v14.scad> + +// Overrides + +//-- which half do you want to print? +printBaseShell = true; +printLidShell = true; + +//-- Edit these parameters for your own board dimensions +wallThickness = 1.6; +basePlaneThickness = 1.6; +lidPlaneThickness = 1.6; + +//-- Label depths +baseLabelDepth = 0.4; +lidLabelDepth = 0.4; +leftLabelDepth = 0.4; +rightLabelDepth = 0.4; +frontLabelDepth = 0.4; +backLabelDepth = 0.4; + +//-- Total height of box = basePlaneThickness + lidPlaneThickness +//-- + baseWallHeight + lidWallHeight +//-- space between pcb and lidPlane := +//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness) +baseWallHeight = 8; +lidWallHeight = 14.4; + +//-- ridge where base and lid off box can overlap +//-- Make sure this isn't less than lidWallHeight +ridgeHeight = 3.0; +ridgeSlack = 0.2; +roundRadius = 3.0; + +//-- pcb dimensions +pcbLength = 2.4 * IN; +pcbWidth = 1.8 * IN; +pcbThickness = 1.6; + +//-- How much the PCB needs to be raised from the base +//-- to leave room for solderings and whatnot +standoffHeight = 3.4; +pinDiameter = 2.7; +standoffDiameter = 6; + +//-- padding between pcb and inside wall +paddingFront = 0.1; +paddingBack = 0.1; +paddingRight = 0.1; +paddingLeft = 0.1; + +//-- pcb_standoffs -- origin is pcb[0,0,0] +// (0) = posx +// (1) = posy +// (2) = { yappBoth | yappLidOnly | yappBaseOnly } +// (3) = { yappHole, YappPin } +pcbStands = [ + [ 4 * IN - origin_x, -4.7 * IN + origin_y, yappBoth, yappPin ], + [ 4 * IN - origin_x, -3.2 * IN + origin_y, yappBoth, yappPin ], + [ 6.1 * IN - origin_x, -3.2 * IN + origin_y, yappBoth, yappPin ], + [ 6.1 * IN - origin_x, -4.7 * IN + origin_y, yappBoth, yappPin ] +]; + +//-- Lid plane -- origin is pcb[0,0,0] +// (0) = posx +// (1) = posy +// (2) = width +// (3) = length +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsLid = [ + [4.8 * IN - origin_x + 1.27, -4.5 * IN + origin_y, 5, 5, 0, yappCircle] +]; + +//-- front plane -- origin is pcb[0,0,0] +// (0) = posy +// (1) = posz +// (2) = width +// (3) = height +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsFront = [ + [-3.67 * IN + origin_y - 9/2, 0, 9, 3.3, 0, yappRectangle] +]; + +//-- back plane -- origin is pcb[0,0,0] +// (0) = posy +// (1) = posz +// (2) = width +// (3) = height +// (4) = angle +// (5) = { yappRectangle | yappCircle } +// (6) = { yappCenter } +cutoutsBack = [ + [21.96, 0, 15.6, 12.7, 0, yappRectangle], + [9.3, 0, 9, 11, 0, yappRectangle] +]; + +//-- snap Joins -- origen = box[x0,y0] +// (0) = posx | posy +// (1) = width +// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more) +// (n) = { yappSymmetric } +snapJoins = [ + [2, 5, yappLeft, yappRight, yappSymmetric] +]; + +//-- origin of labels is box [0,0,0] +// (0) = posx +// (1) = posy/z +// (2) = orientation +// (3) = plane {lid | base | left | right | front | back } +// (4) = font +// (5) = size +// (6) = "label text" +labelsPlane = [ + [12, 35, 0, "lid", "Liberation Mono:style=bold", 4, "Square Dishy"], + [15, 30, 0, "lid", "Liberation Mono:style=bold", 4, "150W PoE++" ], + [15, 25, 0, "lid", "Liberation Mono:style=bold", 4, "50V DC" ], +]; + +// Reference board model +translate([pcbX - origin_x, pcbY + origin_y, pcbZ - pcbThickness / 2]) + %import("poe.stl"); + +// DEBUG +//showSideBySide = false; +onLidGap = 0; + +module lid_diagrams() { + translate([15, 18, -lidLabelDepth]) + linear_extrude(basePlaneThickness) + scale([0.15, 0.15, 1]) + import("Polarity_marking_center_positive.svg"); + + translate([shellLength - frontLabelDepth, 23.5, -12]) + rotate([90, 0, 90]) + linear_extrude(basePlaneThickness) + scale([0.075, 0.075, 1]) + import("plug.svg"); +} + +difference() { + YAPPgenerate(); + + if (printLidShell) { + if (showSideBySide) { + mirror([0,0,1]) + mirror([0,1,0]) + translate([0, (5 + shellWidth+(shiftLid/2))*-2, 0]) + lid_diagrams(); + } else { + translate([0, 0, (baseWallHeight+basePlaneThickness+ + lidWallHeight+lidPlaneThickness+onLidGap)]) + lid_diagrams(); + } + } +}
\ No newline at end of file |