From cf481a4486adfeb182aec97bc913767e37d49654 Mon Sep 17 00:00:00 2001 From: zhao Date: Sun, 5 Feb 2023 09:39:52 -0500 Subject: [PATCH] split sideWallConnector into parts --- rack/side/hingeModule.scad | 44 ++++++++ rack/side/magnetModule.scad | 69 ++++++++++++ rack/side/sideWallMagnetMount.scad | 16 +++ rack/side/sideWallVariables.scad | 27 +++++ rack/side/yBarSideWallConnector.scad | 13 +++ rack/sideWall.scad | 17 +-- rack/sideWallConnector.scad | 156 --------------------------- rack/yBar.scad | 5 +- 8 files changed, 180 insertions(+), 167 deletions(-) create mode 100644 rack/side/hingeModule.scad create mode 100644 rack/side/magnetModule.scad create mode 100644 rack/side/sideWallMagnetMount.scad create mode 100644 rack/side/sideWallVariables.scad create mode 100644 rack/side/yBarSideWallConnector.scad delete mode 100644 rack/sideWallConnector.scad diff --git a/rack/side/hingeModule.scad b/rack/side/hingeModule.scad new file mode 100644 index 0000000..97f652d --- /dev/null +++ b/rack/side/hingeModule.scad @@ -0,0 +1,44 @@ +include <../config.scad> +include <./sideWallVariables.scad> +include <../sharedVariables.scad> +include <../../helper/halfspace.scad> + + +module hingeModule() { + + applyHingePole() + applyYBarScrewMount() + base(); + + module base() { + intersection() { + cube(size = [sideWallConnW, sideWallConnD, sideWallConnLugDepression]); + + // TODO: pattern for this? beef up mirror4XY? + cVal = 0.5; + halfspace(p=[0,cVal,0], vpos=[0,1,1]); + halfspace(p=[cVal,0,0], vpos=[1,0,1]); + halfspace(p=[sideWallConnW-cVal,0,0], vpos=[-1,0,1]); + halfspace(p=[0,sideWallConnD-cVal,0], vpos=[0,-1,1]); + } + } + + module applyHingePole() { + apply_p() { + translate(v = [sideWallConnW-hingePoleR, hingePoleR, sideWallConnH]) + cylinder(r = hingePoleR, h = hingePoleH); + + children(0); + } + } + + + module applyYBarScrewMount() { + apply_n() { + translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression]) + counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10); + + children(0); + } + } +} diff --git a/rack/side/magnetModule.scad b/rack/side/magnetModule.scad new file mode 100644 index 0000000..0023287 --- /dev/null +++ b/rack/side/magnetModule.scad @@ -0,0 +1,69 @@ + +include <../config.scad> +include <./sideWallVariables.scad> +include <../sharedVariables.scad> +include <../../helper/halfspace.scad> +include <../../misc/magnet.scad> + +module magnetModule() { + + applyYBarScrewMount() + applyMagnetMount() + base(); + + module base() { + intersection() { + cube(size = [sideWallConnW, sideWallConnD, sideWallConnLugDepression]); + + // TODO: pattern for this? beef up mirror4XY? + cVal = 0.5; + halfspace(p=[0,cVal,0], vpos=[0,1,1]); + halfspace(p=[cVal,0,0], vpos=[1,0,1]); + halfspace(p=[sideWallConnW-cVal,0,0], vpos=[-1,0,1]); + halfspace(p=[0,sideWallConnD-cVal,0], vpos=[0,-1,1]); + } + } + + module applyYBarScrewMount() { + apply_n() { + translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression]) + counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10); + + children(0); + } + } + + module applyMagnetMount() { + + magnetMountDx = magnetMountShellRadius; + magnetMountDy = magnetMountToYBarFront - sideWallSlotToXZ; + magnetMountDz = magnetMountToYBarTop + sideWallConnLugDepression; + + apply_pn() { + magnetMountShell(); + magnetMountHole(); + children(0); + } + + module magnetMountShell() { + hull() { + translate(v = [0, magnetMountDy, magnetMountDz]) + rotate(a = [0, 90, 0]) + cylinder(r = magnetMountShellRadius, h = sideWallConnW-magnetFaceToSideWallConnOuterYEdge); + + translate(v = [0, 2, sideWallConnH]) + cube(size = [sideWallConnW-magnetFaceToSideWallConnOuterYEdge, 2*magnetMountShellRadius, eps]); + } + } + + module magnetMountHole() { + translate(v = [sideWallConnW-(magnetFaceToSideWallConnOuterYEdge+magnetHSlacked), + magnetMountDy, + magnetMountDz]) + rotate(a = [0, 90, 0]) + cylinder(r = magnetRSlacked, h = magnetHSlacked); + } + } + + +} diff --git a/rack/side/sideWallMagnetMount.scad b/rack/side/sideWallMagnetMount.scad new file mode 100644 index 0000000..a750fae --- /dev/null +++ b/rack/side/sideWallMagnetMount.scad @@ -0,0 +1,16 @@ + +include <../config.scad> +include <./sideWallVariables.scad> +include <../sharedVariables.scad> +include <../../helper/halfspace.scad> +include <../../misc/magnet.scad> + +module sideWallMagnetMount() { + // oriented so that the xy face is the side wall's inner face + difference() { + cylinder(r1 = magnetMountShellRadius+0.5, r2 = magnetMountShellRadius, h = innerSideWallToYBarMagnetConn); + + translate(v=[0, 0, innerSideWallToYBarMagnetConn-magnetHSlacked]) + cylinder(r = magnetRSlacked, h = magnetHSlacked); + } +} diff --git a/rack/side/sideWallVariables.scad b/rack/side/sideWallVariables.scad new file mode 100644 index 0000000..f8990f0 --- /dev/null +++ b/rack/side/sideWallVariables.scad @@ -0,0 +1,27 @@ + +include <../config.scad> +include <../sharedVariables.scad> + + +sideWallConnW = 7; +sideWallConnD = 20; +sideWallConnH = 2; +sideWallConnLugDepression = sideWallConnH; + +yBarScrewHoleToOuterYEdge = 3.5; +yBarScrewHoleToFrontXEdge = 16; + +magnetFaceToSideWallConnOuterYEdge = 2; +magnetMountShellRadius = magnetRSlacked + 1; + +innerSideWallToYBarMagnetConn = magnetFaceToSideWallConnOuterYEdge + sideWallSlotToOuterYEdge - sideWallThickness; + +magnetMountToYBarTop = magnetMountShellRadius + 1; +magnetMountToYBarFront = magnetMountShellRadius + sideWallSlotToXZ + 2; + +hingePoleR = 2; +hingePoleH = 5; +hingeHoleR = hingePoleR + 0.2; + +hingePoleToConnectorOuterYZFace = hingePoleR/2; +hingePoleToConnectorOuterXZFace = hingePoleR/2; \ No newline at end of file diff --git a/rack/side/yBarSideWallConnector.scad b/rack/side/yBarSideWallConnector.scad new file mode 100644 index 0000000..96b0a74 --- /dev/null +++ b/rack/side/yBarSideWallConnector.scad @@ -0,0 +1,13 @@ + +include <../config.scad> +include <./sideWallVariables.scad> +include <../sharedVariables.scad> + + +module yBarSideWallConnector_N() { + translate(v = [0, 0, -sideWallConnLugDepression]) + cube(size = [sideWallConnW, sideWallConnD, sideWallConnLugDepression]); + + translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, -(m3HeatSetInsertSlotHeightSlacked+sideWallConnLugDepression)]) + heatSetInsertSlot_N(rackFrameScrewType); +} diff --git a/rack/sideWall.scad b/rack/sideWall.scad index 8ac891b..ef4061a 100644 --- a/rack/sideWall.scad +++ b/rack/sideWall.scad @@ -3,10 +3,11 @@ include <../helper/halfspace.scad> include <../misc/magnet.scad> include <./config.scad> include <./mainRail.scad> - +include <./side/sideWallMagnetMount.scad> include <./sharedVariables.scad> -include <./sideWallConnector.scad> +include <./side/magnetModule.scad> +include <./side/hingeModule.scad> sideWallZGapClearance = 0.2; @@ -97,19 +98,19 @@ module sideWall() { apply_p() { union() { translate(v = [sideWallThickness, magnetMountToYBarFront, magnetMountToYBarTop]) - sideMagnetMount(); + sideWallMagnetMountRotated(); translate(v = [sideWallThickness, magnetMountToYBarFront, sideWallZ - magnetMountToYBarTop]) - sideMagnetMount(); + sideWallMagnetMountRotated(); } children(0); } - module sideMagnetMount() { + module sideWallMagnetMountRotated() { rotate(a=[0,90,0]) - sideWallConnectorMagnetSide(); + sideWallMagnetMount(); } } @@ -127,8 +128,8 @@ sideWall(); translate(v=[10,sideWallSlotToXZ,-2]) mirror(v=[1,0,0]) -sideWallConnectorMagnet(); +magnetModule(); translate(v=[3,100,0]) mirror(v=[0,1,0]) -sideWallConnectorHinge(); \ No newline at end of file +hingeModule(); diff --git a/rack/sideWallConnector.scad b/rack/sideWallConnector.scad deleted file mode 100644 index 8e8be95..0000000 --- a/rack/sideWallConnector.scad +++ /dev/null @@ -1,156 +0,0 @@ -include <./config.scad> -include <../helper/screws.scad> -include <../helper/halfspace.scad> -include <../misc/magnet.scad> -include <./sharedVariables.scad> - - -sideWallConnW = 7; -sideWallConnD = 20; -sideWallConnH = 2; -sideWallConnLugDepression = sideWallConnH; - -yBarScrewHoleToOuterYEdge = 3.5; -yBarScrewHoleToFrontXEdge = 16; - -magnetFaceToSideWallConnOuterYEdge = 2; -magnetMountShellRadius = magnetRSlacked + 1; - -innerSideWallToYBarMagnetConn = magnetFaceToSideWallConnOuterYEdge + sideWallSlotToOuterYEdge - sideWallThickness; - -magnetMountToYBarTop = magnetMountShellRadius + 1; -magnetMountToYBarFront = magnetMountShellRadius + sideWallSlotToXZ + 2; - -hingePoleR = 2; -hingePoleH = 5; -hingeHoleR = hingePoleR + 0.2; - -hingePoleToConnectorOuterYZFace = hingePoleR/2; -hingePoleToConnectorOuterXZFace = hingePoleR/2; - -*sideWallConnector_N(); -*sideWallConnectorMagnet(); -*sideWallConnectorMagnetSide(); -*sideWallConnectorHinge(); - -module sideWallConnector_N() { - translate(v = [0, 0, -sideWallConnLugDepression]) - cube(size = [sideWallConnW, sideWallConnD, sideWallConnLugDepression]); - - translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, -(m3HeatSetInsertSlotHeightSlacked+sideWallConnLugDepression)]) - heatSetInsertSlot_N(rackFrameScrewType); -} - -module sideWallConnectorMagnet() { - - applyYBarScrewMount() - applyMagnetMount() - base(); - - module base() { - intersection() { - cube(size = [sideWallConnW, sideWallConnD, sideWallConnLugDepression]); - - // TODO: pattern for this? beef up mirror4XY? - cVal = 0.5; - halfspace(p=[0,cVal,0], vpos=[0,1,1]); - halfspace(p=[cVal,0,0], vpos=[1,0,1]); - halfspace(p=[sideWallConnW-cVal,0,0], vpos=[-1,0,1]); - halfspace(p=[0,sideWallConnD-cVal,0], vpos=[0,-1,1]); - } - } - - module applyYBarScrewMount() { - apply_n() { - translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression]) - counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10); - - children(0); - } - } - - module applyMagnetMount() { - - magnetMountDx = magnetMountShellRadius; - magnetMountDy = magnetMountToYBarFront - sideWallSlotToXZ; - magnetMountDz = magnetMountToYBarTop + sideWallConnLugDepression; - - apply_pn() { - magnetMountShell(); - magnetMountHole(); - children(0); - } - - module magnetMountShell() { - hull() { - translate(v = [0, magnetMountDy, magnetMountDz]) - rotate(a = [0, 90, 0]) - cylinder(r = magnetMountShellRadius, h = sideWallConnW-magnetFaceToSideWallConnOuterYEdge); - - translate(v = [0, 2, sideWallConnH]) - cube(size = [sideWallConnW-magnetFaceToSideWallConnOuterYEdge, 2*magnetMountShellRadius, eps]); - } - } - - module magnetMountHole() { - translate(v = [sideWallConnW-(magnetFaceToSideWallConnOuterYEdge+magnetHSlacked), - magnetMountDy, - magnetMountDz]) - rotate(a = [0, 90, 0]) - cylinder(r = magnetRSlacked, h = magnetHSlacked); - } - } - - -} - -module sideWallConnectorHinge() { - - applyHingePole() - applyYBarScrewMount() - base(); - - module base() { - intersection() { - cube(size = [sideWallConnW, sideWallConnD, sideWallConnLugDepression]); - - // TODO: pattern for this? beef up mirror4XY? - cVal = 0.5; - halfspace(p=[0,cVal,0], vpos=[0,1,1]); - halfspace(p=[cVal,0,0], vpos=[1,0,1]); - halfspace(p=[sideWallConnW-cVal,0,0], vpos=[-1,0,1]); - halfspace(p=[0,sideWallConnD-cVal,0], vpos=[0,-1,1]); - } - } - - module applyHingePole() { - apply_p() { - translate(v = [sideWallConnW-hingePoleR, hingePoleR, sideWallConnH]) - cylinder(r = hingePoleR, h = hingePoleH); - - children(0); - } - } - - - module applyYBarScrewMount() { - apply_n() { - translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression]) - counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10); - - children(0); - } - } -} - - -// TODO: better naming -module sideWallConnectorMagnetSide() { - // oriented so that the xy face is the side wall's inner face - difference() { - cylinder(r1 = magnetMountShellRadius+0.5, r2 = magnetMountShellRadius, h = innerSideWallToYBarMagnetConn); - - translate(v=[0, 0, innerSideWallToYBarMagnetConn-magnetHSlacked]) - cylinder(r = magnetRSlacked, h = magnetHSlacked); - } -} diff --git a/rack/yBar.scad b/rack/yBar.scad index 950c727..0a23e5e 100644 --- a/rack/yBar.scad +++ b/rack/yBar.scad @@ -9,9 +9,8 @@ include <./mainRail.scad> // Connectors include <./stackConnector.scad> include <./xyBarConnector.scad> -include <./sideWallConnector.scad> include <./yBarBasePlateConnector.scad> - +include <./side/yBarSideWallConnector.scad> include <./sharedVariables.scad> @@ -73,7 +72,7 @@ module yBar() { apply_n() { mirrorOtherCorner() translate(v = [yBarWidth-(railTotalWidth+railSlotToInnerYEdge+railSlotToSideWallSlot+sideWallConnectorSlotWidth), sideWallSlotToXZ, yBarHeight]) - sideWallConnector_N(); + yBarSideWallConnector_N(); children(0); }