diff --git a/rack/assembly/common.scad b/rack/assembly/common.scad index 42917e9..7c4339a 100644 --- a/rack/assembly/common.scad +++ b/rack/assembly/common.scad @@ -1,14 +1,14 @@ include <../../helper/common.scad> include <../../config/common.scad> -include <../mainRail.scad> -include <../yBar.scad> -include <../xBar.scad> -include <../side/magnetModule.scad> -include <../side/hingeModule.scad> -include <../side/sideWallRight.scad> -include <../side/sideWallLeft.scad> -include <../stackEnds.scad> -include <../xyPlate.scad> +use <../mainRail.scad> +use <../yBar.scad> +use <../xBar.scad> +use <../side/magnetModule.scad> +use <../side/hingeModule.scad> +use <../side/sideWallRight.scad> +use <../side/sideWallLeft.scad> +use <../stackEnds.scad> +use <../xyPlate.scad> screwMask = false; plasticMask = false; diff --git a/rack/assembly/slideHexNutsIntoYBarXYPlate.scad b/rack/assembly/slideHexNutsIntoYBarXYPlate.scad index 4d1ac4d..ba5f19f 100644 --- a/rack/assembly/slideHexNutsIntoYBarXYPlate.scad +++ b/rack/assembly/slideHexNutsIntoYBarXYPlate.scad @@ -21,7 +21,7 @@ module slideHexNutsIntoYBarXYPlate(at=0) { module plateHexNut(t) { multmatrix(yBarBasePlateConnectorTrans) - translate(v=[basePlateYBarSlideNutDx+t, basePlateYBarSlideNutDy, 4 + _baseConnRecession]) // TODO gotta rename these + translate(v=[basePlateYBarSlideNutDx+t, basePlateYBarSlideNutDy, 4 + plateBlockBaseConnRecession]) // TODO gotta rename these hexNut(rackFrameScrewType); } diff --git a/rack/connector/basePlateYBarConnectors.scad b/rack/connector/basePlateYBarConnectors.scad index 11f6a16..45df3f9 100644 --- a/rack/connector/basePlateYBarConnectors.scad +++ b/rack/connector/basePlateYBarConnectors.scad @@ -2,28 +2,6 @@ include <../../helper/common.scad> include <../../config/common.scad> include <../sharedVariables.scad> -// Dimensions for the connector block, applied to y-bar -yBarXYPlateBlockX = 12; -yBarXYPlateBlockY = 14; -yBarXYPlateBlockZ = 10; - -// Needed for y bar to align this connector to its inner Y edge -yBarBasePlateConnectorWidth = yBarXYPlateBlockX; - -// x and y faces of the yBarBasePlateMount_P block -_innerXFaceToScrew = 6; -_innerYFaceToScrew = 8; -_baseConnRecession = 3; -_baseConnY = 8; -_baseConnOuterXFaceToScrew = 2; - -basePlateYBarSlideNutDx = yBarXYPlateBlockX - _innerXFaceToScrew; -basePlateYBarSlideNutDy = yBarXYPlateBlockY - _innerYFaceToScrew; - -// TODO refactor this entire file -basePlateScrewMountToYBarXZFace = basePlateYBarSlideNutDy + joinCornerDepth; // Distance to the nearest YBar XZ face -basePlateScrewMountToYBarYZFace = (yBarWidth+basePlateYBarSlideNutDx) - yBarBasePlateConnectorWidth; - module onYBarBasePlateConnectorPositive() { translate(v=[0,0,yBarWallThickness]) intersection() { @@ -34,17 +12,17 @@ module onYBarBasePlateConnectorPositive() { module onYBarBasePlateConnectorNegative() { - translate(v=[basePlateYBarSlideNutDx, basePlateYBarSlideNutDy, 4 + _baseConnRecession]) + translate(v=[basePlateYBarSlideNutDx, basePlateYBarSlideNutDy, 4 + plateBlockBaseConnRecession]) mirror(v=[0,0,1]) hexNutPocket_N("m3", openSide=false, backSpace=5, bridgeBack=true); hull() { // This has always been a pretty annoying to fit part. Increasing slack to 2*radiusXYSlack to compensate. TODO fix - translate(v = [basePlateYBarSlideNutDx, basePlateYBarSlideNutDy, _baseConnRecession+overhangSlack]) + translate(v = [basePlateYBarSlideNutDx, basePlateYBarSlideNutDy, plateBlockBaseConnRecession+overhangSlack]) roundCutSlice(radius = heatSetInsertSlotRadiusSlacked(rackFrameScrewType)+2*radiusXYSlack); translate(v = [basePlateYBarSlideNutDx, basePlateYBarSlideNutDy, 0]) - roundCutSlice(radius = _baseConnY/2 + 2*radiusXYSlack); + roundCutSlice(radius = plateBlockBaseConnY/2 + 2*radiusXYSlack); } } diff --git a/rack/connector/connectors.scad b/rack/connector/connectors.scad index 9070b64..bb71531 100644 --- a/rack/connector/connectors.scad +++ b/rack/connector/connectors.scad @@ -7,11 +7,7 @@ include <./mainRailYBarConnectors.scad> include <./sideModuleYBarConnectors.scad> include <./stackYBarConnectors.scad> include <./basePlateYBarConnectors.scad> - -mirror(v=[1,0,0]) -*connectorDebug(on="xBar", to="yBar", trans=identity); - -*connectorDebug(on="yBar", to="xBar", trans=identity); +include <./transformations.scad> // Default is to apply the positive first module applyConnector(on, to, trans) { @@ -27,7 +23,6 @@ module applyConnector(on, to, trans) { } } - module connectorDebug(on, to, trans) { color([0,1,0]) @@ -37,10 +32,8 @@ module connectorDebug(on, to, trans) { color([1,0,0]) multmatrix(trans) connectorNegative(on=on, to=to); - } - module applyConnectorDebug(on,to,trans) { echo("on: ", on, "-- to:", to); @@ -83,5 +76,4 @@ module connectorNegative(on, to) { } else if (on == "mainRail" && to == "yBar") { onMainRailYBarConnectorNegative(); } - } diff --git a/rack/connector/stackYBarConnectors.scad b/rack/connector/stackYBarConnectors.scad index 2cf1360..42cefd6 100644 --- a/rack/connector/stackYBarConnectors.scad +++ b/rack/connector/stackYBarConnectors.scad @@ -3,22 +3,6 @@ include <../../config/common.scad> include <../sharedVariables.scad> -connectorYEdgeToYBarYEdge = 5; -connectorXEdgeToYBarXEdge = 5; - -connectorRectWidth = 10; -connectorRectDepth = 10; -connectorTotalHeight = 10; -connectorSocketMagnetExtrudeHeight = 1; -connectorTaperStartHeight = 3; - -connectorTopR = 3; - -connectorRectPlugSlack = -0.2; -connectorRectSocketSlack = 0.2; - -connectorBottomToScrew = 6; - module stackConnectorBase(rectSlack, topSlack=0.0) { wSlacked = connectorRectWidth + rectSlack; diff --git a/rack/connector/transformations.scad b/rack/connector/transformations.scad new file mode 100644 index 0000000..ed38385 --- /dev/null +++ b/rack/connector/transformations.scad @@ -0,0 +1,34 @@ +include <../../helper/common.scad> +include <../../config/common.scad> +include <../sharedVariables.scad> + +// Y-bar +yBarMirrorOtherCornerTrans = translate(v = [0, yBarDepth, 0]) * mirror(v = [0, 1, 0]); + +yBarBasePlateConnectorTrans = translate(v = [yBarWidth-yBarBasePlateConnectorWidth, joinCornerDepth, 0]); + +yBarStackConnectorTrans = translate(v = [connectorXEdgeToYBarXEdge, connectorYEdgeToYBarYEdge, 0]); + +yBarSideModuleConnectorTrans = translate(v = [ + yBarWidth-(railTotalWidth+railSlotToInnerYEdge+railSlotToSideWallSlot+sideWallConnectorSlotWidth), + sideWallSlotToXZ, + yBarHeight + ]); + +yBarMainRailConnectorTrans = translate(v = [ + yBarWidth-(railTotalWidth+railSlotToInnerYEdge), + railSlotToXZ, + yBarHeight-railFootThickness + ]); + +yBarXBarConnectorTrans = translate(v = [yBarWidth+eps, 0, 0]); + + +// X-bar +xBarYBarConnectorTrans = rotate(a=[0,0,-90]); +xBarMirrorOtherCornerTrans = translate(v = [0, xBarX, 0]) * mirror(v = [0, 1, 0]); + + +// Main rail +mirrorMainRailOtherSideTrans = translate(v = [0, 0, railTotalHeight]) * mirror(v=[0,0,1]); + diff --git a/rack/mainRail.scad b/rack/mainRail.scad index a18d242..1b9bd56 100644 --- a/rack/mainRail.scad +++ b/rack/mainRail.scad @@ -67,9 +67,4 @@ module mainRail() { children(0); } } - } - -// used in assembly -mirrorMainRailOtherSideTrans = translate(v = [0, 0, railTotalHeight]) * mirror(v=[0,0,1]); - diff --git a/rack/print/rackJoiner_P.scad b/rack/print/rackJoiner_P.scad index 48b6a95..13a10f8 100644 --- a/rack/print/rackJoiner_P.scad +++ b/rack/print/rackJoiner_P.scad @@ -1,4 +1,4 @@ -include <../stackEnds.scad> +use <../stackEnds.scad> // Oriented for 3d printing. No supports required, but it's reccommended to print this with a brim. // Adding a brim will require some post-processing in the form of trimming the bottom. diff --git a/rack/print/stackConnectorBottom_P.scad b/rack/print/stackConnectorBottom_P.scad index 23e9266..7f70e08 100644 --- a/rack/print/stackConnectorBottom_P.scad +++ b/rack/print/stackConnectorBottom_P.scad @@ -1,4 +1,4 @@ -include <../stackEnds.scad> +use <../stackEnds.scad> // Oriented for 3d printing. No supports required. stackConnectorBottom(); \ No newline at end of file diff --git a/rack/sharedVariables.scad b/rack/sharedVariables.scad index f0db526..781c40e 100644 --- a/rack/sharedVariables.scad +++ b/rack/sharedVariables.scad @@ -29,15 +29,13 @@ frontFaceWidth = railScrewHoleToInnerEdge + railScrewHoleToOuterEdge; railTotalWidth = frontFaceWidth; railTotalDepth = railFrontThickness+sideSupportDepth; - -// Side Wall variables: +// Side Wall variables, cannot put in sideWallVariables due to dependency by ybar sideWallThickness = 2.5; sideWallSlotToOuterYEdge = 3; -sideWallSlotToOuterXEdge = 3; // TODO rename to variables found in ybar; +sideWallSlotToOuterXEdge = 3; // TODO rename to variables found in ybar sideWallConnectorSlotWidth = 7; - // Y Bar variables: railSlotToXZ = 3; sideWallSlotToXZ = 3; @@ -66,5 +64,48 @@ xBarRoundness = baseRoundness; rackTotalWidth = 2*yBarWidth + xBarX; rackTotalDepth = yBarDepth; + +// Dimensions for the connector block, applied to y-bar +yBarXYPlateBlockX = 12; +yBarXYPlateBlockY = 14; +yBarXYPlateBlockZ = 10; + +// Needed for y bar to align this connector to its inner Y edge +yBarBasePlateConnectorWidth = yBarXYPlateBlockX; + +// x and y faces of the yBarBasePlateMount_P block +plateBlockInnerXFaceToScrew = 6; +plateBlockInnerYFaceToScrew = 8; +plateBlockBaseConnRecession = 3; +plateBlockBaseConnY = 8; + +basePlateYBarSlideNutDx = yBarXYPlateBlockX - plateBlockInnerXFaceToScrew; +basePlateYBarSlideNutDy = yBarXYPlateBlockY - plateBlockInnerYFaceToScrew; + +basePlateScrewMountToYBarXZFace = basePlateYBarSlideNutDy + joinCornerDepth; // Distance to the nearest YBar XZ face +basePlateScrewMountToYBarYZFace = (yBarWidth+basePlateYBarSlideNutDx) - yBarBasePlateConnectorWidth; + +xyPlateConnDx = xBarX + 2*basePlateYBarSlideNutDx; // X distance between connectors +xyPlateConnDy = yBarDepth - 2*basePlateScrewMountToYBarXZFace; // Y distance between connectors plateGap = 1; // distance between edge of xy plate and other parts assert(plateGap >= xySlack); + + +connectorYEdgeToYBarYEdge = 5; +connectorXEdgeToYBarXEdge = 5; + +connectorRectWidth = 10; +connectorRectDepth = 10; +connectorTotalHeight = 10; + +connectorSocketMagnetExtrudeHeight = 1; +connectorTaperStartHeight = 3; +connectorTopR = 3; +connectorRectPlugSlack = -0.2; +connectorRectSocketSlack = 0.2; +connectorBottomToScrew = 6; +// Distance from midpoint of stack connectors to each other +stackConnectorDx = rackTotalWidth - 2*(connectorXEdgeToYBarXEdge + connectorRectWidth/2); +stackConnectorDy = rackTotalDepth - 2*(connectorYEdgeToYBarYEdge + connectorRectDepth/2); +stackConnectorDualSpacing = 0.5; + diff --git a/rack/side/magnetModule.scad b/rack/side/magnetModule.scad index 1af99c4..89ec6dc 100644 --- a/rack/side/magnetModule.scad +++ b/rack/side/magnetModule.scad @@ -6,9 +6,6 @@ include <./sideWallVariables.scad> translate(v=[10,-5,-(2+sideWallZHingeTotalClearance)]) *magnetModule(); -magnetModuleMagnetMountDy = magnetMountToYBarFront - sideWallSlotToXZ; -magnetModuleMagnetMountDz = magnetMountToYBarTop + sideWallConnLugDepression; - module magnetModule() { applyYBarScrewMount() diff --git a/rack/side/sideWallVariables.scad b/rack/side/sideWallVariables.scad index 7e99a36..e3e8b5d 100644 --- a/rack/side/sideWallVariables.scad +++ b/rack/side/sideWallVariables.scad @@ -36,4 +36,7 @@ hingePoleDy = sideWallY - (sideWallSlotToOuterXEdge + (hingePoleR+radiusXYSlack) sideWallDefaultVerticalBracingToZEdge = 30; sideWallDefaultVentilationToZEdge = 40; sideWallDefaultVentilationToYEdge = 25; -sideWallDefaultVentilationWidth = 6; \ No newline at end of file +sideWallDefaultVentilationWidth = 6; + +magnetModuleMagnetMountDy = magnetMountToYBarFront - sideWallSlotToXZ; +magnetModuleMagnetMountDz = magnetMountToYBarTop + sideWallConnLugDepression; diff --git a/rack/stackEnds.scad b/rack/stackEnds.scad index ab95048..35934ec 100644 --- a/rack/stackEnds.scad +++ b/rack/stackEnds.scad @@ -2,11 +2,6 @@ include <../helper/common.scad> include <./sharedVariables.scad> include <./connector/connectors.scad> -// Distance from midpoint of stack connectors to each other -stackConnectorDx = rackTotalWidth - 2*(connectorXEdgeToYBarXEdge + connectorRectWidth/2); -stackConnectorDy = rackTotalDepth - 2*(connectorYEdgeToYBarYEdge + connectorRectDepth/2); -stackConnectorDualSpacing = 0.5; - module rackJoiner() { translate(v=[0,0,stackConnectorDualSpacing/2]) stackConnectorPlug(); diff --git a/rack/xBar.scad b/rack/xBar.scad index 943bf4c..22d08f0 100644 --- a/rack/xBar.scad +++ b/rack/xBar.scad @@ -45,7 +45,3 @@ module xBar() { } } - -xBarYBarConnectorTrans = rotate(a=[0,0,-90]); - -xBarMirrorOtherCornerTrans = translate(v = [0, xBarX, 0]) * mirror(v = [0, 1, 0]); \ No newline at end of file diff --git a/rack/xyPlate.scad b/rack/xyPlate.scad index ed8a98c..ef8a828 100644 --- a/rack/xyPlate.scad +++ b/rack/xyPlate.scad @@ -3,9 +3,6 @@ include <./connector/connectors.scad> *xyPlate(); -xyPlateConnDx = xBarX + 2*basePlateYBarSlideNutDx; // X distance between connectors -xyPlateConnDy = yBarDepth - 2*basePlateScrewMountToYBarXZFace; // Y distance between connectors - module xyPlate() { translate(v=-[connPosX,connPosY,0]) // center around one of the YBarConnector holes @@ -87,9 +84,9 @@ module xyPlate() { difference() { hull() { // TODO: we don't need to heatset insert values anymore - translate(v=[0,0,_baseConnRecession]) + translate(v=[0,0,plateBlockBaseConnRecession]) roundCutSlice(radius = heatSetInsertSlotRadiusSlacked(rackFrameScrewType), length=5); - roundCutSlice(radius = _baseConnY/2, length=15); + roundCutSlice(radius = plateBlockBaseConnY/2, length=15); } mirror(v=[0,0,1]) counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10); diff --git a/rack/yBar.scad b/rack/yBar.scad index 3016dbe..66aba2e 100644 --- a/rack/yBar.scad +++ b/rack/yBar.scad @@ -34,23 +34,3 @@ module yBar() { children(0); } } - -yBarMirrorOtherCornerTrans = translate(v = [0, yBarDepth, 0]) * mirror(v = [0, 1, 0]); - -yBarBasePlateConnectorTrans = translate(v = [yBarWidth-yBarBasePlateConnectorWidth, joinCornerDepth, 0]); - -yBarStackConnectorTrans = translate(v = [connectorXEdgeToYBarXEdge, connectorYEdgeToYBarYEdge, 0]); - -yBarSideModuleConnectorTrans = translate(v = [ - yBarWidth-(railTotalWidth+railSlotToInnerYEdge+railSlotToSideWallSlot+sideWallConnectorSlotWidth), - sideWallSlotToXZ, - yBarHeight - ]); - -yBarMainRailConnectorTrans = translate(v = [ - yBarWidth-(railTotalWidth+railSlotToInnerYEdge), - railSlotToXZ, - yBarHeight-railFootThickness - ]); - -yBarXBarConnectorTrans = translate(v = [yBarWidth+eps, 0, 0]);