diff --git a/rack2/helper/cylindricalFilet.scad b/helper/cylindricalFilet.scad similarity index 100% rename from rack2/helper/cylindricalFilet.scad rename to helper/cylindricalFilet.scad diff --git a/rack2/helper/sphericalFilet.scad b/helper/sphericalFilet.scad similarity index 100% rename from rack2/helper/sphericalFilet.scad rename to helper/sphericalFilet.scad diff --git a/misc/magnet.scad b/misc/magnet.scad index 74bedc5..34cd5c3 100644 --- a/misc/magnet.scad +++ b/misc/magnet.scad @@ -1,6 +1,11 @@ // Dimensions for small cylindrical neodymium magnets that I bought off Amazon -magnetD = 6; -magnetR = magnetD/2; -magnetH = 1.7; \ No newline at end of file +magnetR = 3; +magnetH = 1.7; + +magnetRSlack = 0.1; +magnetHSlack = 0.05; + +magnetRSlacked = magnetR + magnetRSlack; +magnetHSlacked = magnetH + magnetHSlack; \ No newline at end of file diff --git a/rack2/assemble.scad b/rack2/assemble.scad index ac09701..db76f0c 100644 --- a/rack2/assemble.scad +++ b/rack2/assemble.scad @@ -1,8 +1,41 @@ include <../math.scad> include <./config.scad> include <./mainRail.scad> -include <./sideBar.scad> +include <./yBar.scad> +include <./xBar.scad> +translate(v=[12,2,18]) +mainRail(); -*mainRail(); -sideBar(); +translate(v=[12,2 + 200,18]) +mirror(v=[0,1,0]) +mainRail(); + +translate(v=[12 + 216,2,18]) +mirror(v=[1,0,0]) +mainRail(); + +translate(v=[12 + 216,2 + 200,18]) +rotate(a=[0,0,180]) +mainRail(); + +xyPlane(); + +translate(v=[0,0,250]) +mirror(v=[0,0,1]) +xyPlane(); + +module xyPlane() { + yBar(); + + translate(v = [240, 0, 0]) + mirror(v = [1, 0, 0]) + yBar(); + + translate(v = [30, 0, 0]) + xBar(); + + translate(v = [30, 206, 0]) + mirror(v = [0, 1, 0]) + xBar(); +} \ No newline at end of file diff --git a/rack2/config.scad b/rack2/config.scad index 42d28e1..f1e81c4 100644 --- a/rack2/config.scad +++ b/rack2/config.scad @@ -20,7 +20,7 @@ maxUnitDepth = 200; screwDiff = 10; // Number screw slots on the main rail. Affects build volume. -numRailScrews = 3; +numRailScrews = 20; // Screw type used for rackmount units. See screws.scad. mainRailScrewType = "m4"; diff --git a/rack2/connectingBar.stl b/rack2/connectingBar.stl deleted file mode 100644 index 4cbdfcc..0000000 Binary files a/rack2/connectingBar.stl and /dev/null differ diff --git a/rack2/connectingBarShort.stl b/rack2/connectingBarShort.stl deleted file mode 100644 index a1c65ce..0000000 Binary files a/rack2/connectingBarShort.stl and /dev/null differ diff --git a/rack2/connectingRailShort.stl b/rack2/connectingRailShort.stl deleted file mode 100644 index a1c65ce..0000000 Binary files a/rack2/connectingRailShort.stl and /dev/null differ diff --git a/rack2/mainRail.scad b/rack2/mainRail.scad index 5a57fc9..ecb8437 100644 --- a/rack2/mainRail.scad +++ b/rack2/mainRail.scad @@ -31,6 +31,7 @@ railTotalDepth = railFrontThickness+sideSupportDepth; echo("Total Rail Height: ", railTotalHeight); +// Also known as the z-bar :) module mainRail() { union() { diff --git a/rack2/mainRail.stl b/rack2/mainRail.stl index 75de839..94ebd91 100644 Binary files a/rack2/mainRail.stl and b/rack2/mainRail.stl differ diff --git a/rack2/misc/magnet.scad b/rack2/misc/magnet.scad deleted file mode 100644 index 34cd5c3..0000000 --- a/rack2/misc/magnet.scad +++ /dev/null @@ -1,11 +0,0 @@ - - -// Dimensions for small cylindrical neodymium magnets that I bought off Amazon -magnetR = 3; -magnetH = 1.7; - -magnetRSlack = 0.1; -magnetHSlack = 0.05; - -magnetRSlacked = magnetR + magnetRSlack; -magnetHSlacked = magnetH + magnetHSlack; \ No newline at end of file diff --git a/rack2/sideBar.scad b/rack2/sideBar.scad deleted file mode 100644 index 636e697..0000000 --- a/rack2/sideBar.scad +++ /dev/null @@ -1,132 +0,0 @@ -include <../math.scad> -include <./config.scad> -include <./screws.scad> -include <./misc/magnet.scad> - -include <./mainRail.scad> -include <./helper/sphericalFilet.scad> -include <./helper/cylindricalFilet.scad> - -// TODO clean up -// TODO: How do I nicely explain this? -railSlotSpacing = 3; -sideSpacing = 12; - -barDepth = maxUnitDepth + 2*railSlotSpacing; -barWidth = railSlotSpacing + railTotalWidth + sideSpacing; -barHeight = 15; - -barWallThickness = 3; -barRoundness = 5; - -echo("Bar total depth: ", barDepth); -echo("Bar total width: ", barWidth); - - -module sideBar() { - - module positive() { - difference() { - sphericalFiletEdge(barWidth, barDepth, barHeight, barRoundness); - - translate(v = [barWallThickness, 32, barWallThickness]) - cylindricalFiletEdge(barWidth, barDepth-32*2, barHeight, barRoundness); - } - - } - - module stackConn_N() { - taperH = 2; - - translate(v=[0,0,0]) - cube(size = [10, 10, taperH]); - - - hull() { - translate(v = [0, 0, taperH]) - linear_extrude(height=eps) - square(size = [10, 10]); - - translate(v=[5,5,5]) - linear_extrude(height=eps) - circle(r=magnetRSlacked); - } - - // -1 is for male support - translate(v=[5,5,5 - 1]) - cylinder(r=magnetRSlacked, h=magnetHSlacked); - } - - // TODO move this to custom file - // negatives on the y-z plane to be imprinted on the side of the main - module frontBarConnector_N() { - - y1 = 6; - y2 = 27; - z = 6; - - translate(v = [-m3HeatSetInsertSlotHeightSlacked, y1, z]) - rotate(a = [0, 90, 0]) - heatSetInsertSlot_N(rackFrameScrewType); - - translate(v = [-m3HeatSetInsertSlotHeightSlacked, y2, z]) - rotate(a = [0, 90, 0]) - heatSetInsertSlot_N(rackFrameScrewType); - - // TODO fix this up, no center=true - translate(v=[-1, y1 + (y2 - y1)/2, 0]) - rotate(a=[0,45,0]) - cube(size=[3,10,6], center=true); - } - - // TODO move this in custom file, like for railFeetSlot_N - module sideWallConnector_N() { - - lugW = 7; - lugD = 20; - lugH = 2; - - insertDw = lugW/2; - - insertDd = lugD - 4; - - translate(v=[0,0, -lugH]) - cube(size=[lugW, lugD, lugH]); - - translate(v=[insertDw, insertDd, -(m3HeatSetInsertSlotHeightSlacked + lugH)]) - heatSetInsertSlot_N(rackFrameScrewType); - } - - - module singleCorner_N() { - union() { - translate(v=[5,5,0]) - stackConn_N(); - - translate(v=[barWidth - (railTotalWidth + railSlotSpacing), railSlotSpacing, barHeight - railFootThickness]) - railFeetSlot_N(); - - translate(v=[barWidth + eps, 0,0]) - frontBarConnector_N(); - - - translate(v=[barWidth - (railTotalWidth + railSlotSpacing) - 9, railSlotSpacing, barHeight]) - sideWallConnector_N(); - } - } - - module sideBar() { - difference() { - positive(); - - singleCorner_N(); - - translate(v=[0,barDepth,0]) - mirror(v=[0,1,0]) { - singleCorner_N(); - } - } - - } - sideBar(); -} diff --git a/rack2/stackConnector.scad b/rack2/stackConnector.scad new file mode 100644 index 0000000..9aaf4cd --- /dev/null +++ b/rack2/stackConnector.scad @@ -0,0 +1,111 @@ +include <../math.scad> +include <../misc/magnet.scad> +include <../common.scad> + +connectorTaperStartHeight = 2; +connectorRectWidth = 10; +connectorRectDepth = 10; + +connectorTotalHeight = 5; + +connectorRectPlugSlack = -0.1; +connectorRectSocketSlack = 0.1; + +connectorSocketMagnetExtrudeHeight = 1; + +module stackConnectorBase(rectSlack) { + + _wSlacked = connectorRectWidth + rectSlack; + _dSlacked = connectorRectDepth + rectSlack; + + module connRect() { + linear_extrude(height=eps) + square(size = [_wSlacked, _dSlacked]); + } + + module connMagnetMount() { + linear_extrude(height=eps) + circle(r=magnetRSlacked); + } + + hull() { + connRect(); + + translate(v=[0,0,connectorTaperStartHeight]) + connRect(); + } + + hull() { + translate(v = [0, 0, connectorTaperStartHeight]) + connRect(); + + translate(v=[_wSlacked/2, _dSlacked/2, connectorTotalHeight]) + connMagnetMount(); + } +} + +module stackConnectorPlug() { + assert(magnetHSlacked > connectorSocketMagnetExtrudeHeight); + + _wSlacked = connectorRectWidth + connectorRectPlugSlack; + _dSlacked = connectorRectDepth + connectorRectPlugSlack; + + magnetLevelHeight = connectorTotalHeight - (magnetHSlacked - connectorSocketMagnetExtrudeHeight); + + difference() { + + intersection() { + stackConnectorBase(connectorRectPlugSlack); + cube(size=[_dSlacked, _wSlacked, magnetLevelHeight]); + } + + translate(v = [_wSlacked/2, _dSlacked/2, magnetLevelHeight - magnetHSlacked]) + cylinder(r = magnetRSlacked, h = magnetHSlacked); + + } +} + +module stackConnectorSocket_N() { + + _wSlacked = connectorRectWidth + connectorRectSocketSlack; + _dSlacked = connectorRectDepth + connectorRectSocketSlack; + + _bevelSlack = 0.5; + _bevelR = _wSlacked + _bevelSlack; + _bevelW = _dSlacked + _bevelSlack; + _bevelH = 0.5; + + + stackConnectorBase(connectorRectSocketSlack); + + translate(v=[_wSlacked/2, _wSlacked/2, connectorTotalHeight - connectorSocketMagnetExtrudeHeight]) + cylinder(r=magnetRSlacked, h=magnetHSlacked); + + // bevel at the lip of the socket to guide the plug, as well as mitigate elephant foot during 3d printing + hull() { + translate(v=[0,0,_bevelH]) + linear_extrude(height=eps) + square(size = [_wSlacked, _dSlacked]); + + translate(v=[-_bevelSlack/2, -_bevelSlack/2, 0]) + linear_extrude(height=eps) + square(size = [_bevelR, _bevelW]); + } +} + +module test() { + difference() { + union() { + translate(v = [-2.5, -2.5, 0]) + cube(size = [15, 15, 10]); + + translate(v = [0, 0, 10]) + stackConnectorPlug(); + } + + stackConnectorSocket_N(); + } +} + +*test(); + diff --git a/rack2/stackConnector.stl b/rack2/stackConnector.stl new file mode 100644 index 0000000..e6df8cd Binary files /dev/null and b/rack2/stackConnector.stl differ diff --git a/rack2/xBar.scad b/rack2/xBar.scad new file mode 100644 index 0000000..7f6ec2a --- /dev/null +++ b/rack2/xBar.scad @@ -0,0 +1,34 @@ +include <../helper/sphericalFilet.scad> +include <../helper/cylindricalFilet.scad> +include <./config.scad> +include <./screws.scad> + +xBarDepth = 180; +xBarWidth = 32; +xBarHeight = 15; + +xBarWallThickness = 3; +xBarRoundness = 5; + +module xBar() { + + module positive() { + mirror(v=[0,1,0]) + rotate(a=[0,0,-90]) + difference() { + cylindricalFiletEdge(xBarWidth, xBarDepth, xBarHeight, xBarRoundness); + + translate(v = [xBarWallThickness, xBarWallThickness, xBarWallThickness]) + cylindricalFiletEdge(xBarWidth, xBarDepth - 2*xBarWallThickness, xBarHeight, xBarRoundness); + } + } + + module xBar() { + positive(); + } + + xBar(); +} + + +//xBar(); \ No newline at end of file diff --git a/rack2/yBar.scad b/rack2/yBar.scad new file mode 100644 index 0000000..1572e6c --- /dev/null +++ b/rack2/yBar.scad @@ -0,0 +1,114 @@ +include <../math.scad> +include <../misc/magnet.scad> +include <../helper/sphericalFilet.scad> +include <../helper/cylindricalFilet.scad> +include <./config.scad> +include <./screws.scad> +include <./mainRail.scad> +include <./stackConnector.scad> + +// TODO clean up +// TODO: How do I nicely explain this? +railSlotSpacing = 3; +sideSpacing = 12; + +yBarDepth = maxUnitDepth + 2*railSlotSpacing; +yBarWidth = railSlotSpacing + railTotalWidth + sideSpacing; +yBarHeight = 15; + +yBarWallThickness = 3; +yBarRoundness = 5; + +echo("Bar total depth: ", yBarDepth); +echo("Bar total width: ", yBarWidth); + + +module yBar() { + + module positive() { + difference() { + sphericalFiletEdge(yBarWidth, yBarDepth, yBarHeight, yBarRoundness); + + translate(v = [yBarWallThickness, 32, yBarWallThickness]) + cylindricalFiletEdge(yBarWidth, yBarDepth-32*2, yBarHeight, yBarRoundness); + } + } + + // TODO move this to custom file + // negatives on the y-z plane to be imprinted on the side of the main + module frontBarConnector_N() { + + y1 = 6; + y2 = 27; + z = 6; + + translate(v = [-m3HeatSetInsertSlotHeightSlacked, y1, z]) + rotate(a = [0, 90, 0]) + heatSetInsertSlot_N(rackFrameScrewType); + + translate(v = [-m3HeatSetInsertSlotHeightSlacked, y2, z]) + rotate(a = [0, 90, 0]) + heatSetInsertSlot_N(rackFrameScrewType); + + // TODO fix this up, no center=true + translate(v = [-1, y1+(y2-y1)/2, 0]) + rotate(a = [0, 45, 0]) + cube(size = [3, 10, 6], center = true); + } + + // TODO move this in custom file, like for railFeetSlot_N + module sideWallConnector_N() { + + lugW = 7; + lugD = 20; + lugH = 2; + + insertDw = lugW/2; + + insertDd = lugD-4; + + translate(v = [0, 0, -lugH]) + cube(size = [lugW, lugD, lugH]); + + translate(v = [insertDw, insertDd, -(m3HeatSetInsertSlotHeightSlacked+lugH)]) + heatSetInsertSlot_N(rackFrameScrewType); + } + + + module singleCornerNoStackConnector_N() { + union() { + translate(v = [5, 5, 0]) + stackConnectorSocket_N(); + + translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing), railSlotSpacing, yBarHeight-railFootThickness]) + railFeetSlot_N(); + + translate(v = [yBarWidth+eps, 0, 0]) + frontBarConnector_N(); + + translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing)-9, railSlotSpacing, yBarHeight]) + sideWallConnector_N(); + } + } + + module sideBar() { + + module mirrorOtherCorner() { + children(0); + + translate(v = [0, yBarDepth, 0]) + mirror(v = [0, 1, 0]) { + children(0); + } + } + + difference() { + positive(); + + mirrorOtherCorner() + singleCornerNoStackConnector_N(); + } + } + + sideBar(); +}