Add option for fixed side modules. This simplifies assembly and removes some awkward printing topology
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
include <./common.scad>
|
||||
use <./slideHexNutsIntoYBar.scad>
|
||||
|
||||
$vpt = [21,-15,20];
|
||||
$vpr = [65,0,40];
|
||||
@ -10,8 +11,16 @@ addMagnetsToMagnetModules(at=$t);
|
||||
module addMagnetsToMagnetModules(at=0) {
|
||||
t = lerp(a=6,b=0,t=at);
|
||||
|
||||
|
||||
if (!plasticMask) {
|
||||
magnetModule();
|
||||
|
||||
if (fixedSideModules) {
|
||||
multmatrix(yBarToMagnetModuleTrans)
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
}
|
||||
else {
|
||||
magnetModule();
|
||||
}
|
||||
}
|
||||
|
||||
function insertMagnetTrans(t=0) =
|
||||
@ -20,6 +29,9 @@ module addMagnetsToMagnetModules(at=0) {
|
||||
magnetModuleMagnetMountDz]) *
|
||||
rotate(a=[0,90,0]);
|
||||
|
||||
multmatrix(insertMagnetTrans(t=t))
|
||||
magnet();
|
||||
|
||||
|
||||
multmatrix(insertMagnetTrans(t=t))
|
||||
magnet();
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,11 @@ include <./common.scad>
|
||||
use <./screwXBarAndYBar.scad>
|
||||
use <./addMagnetsToMagnetModules.scad>
|
||||
|
||||
|
||||
/*
|
||||
NOTE You only need to do this step if the `fixedSideModules` option is set to false.
|
||||
*/
|
||||
|
||||
$vpt = [116,90,18];
|
||||
$vpr = [56,0,42];
|
||||
$vpd = 550;
|
||||
@ -10,50 +15,57 @@ $vpf = 22.50;
|
||||
attachSideConnectorModulesToYBars(at=$t);
|
||||
|
||||
module attachSideConnectorModulesToYBars(at=0) {
|
||||
elevation = lerp(a=8, b=0, t=at);
|
||||
elevation = lerp(a=8, b=0, t=at);
|
||||
|
||||
// side module to front corner ybar
|
||||
function sideModuleTrans(t=0) =
|
||||
translate(v=[sideWallConnW,0,t-sideWallConnLugDepression])
|
||||
* yBarSideModuleConnectorTrans
|
||||
* mirror(v=[1,0,0]); // mirror for magnetModule
|
||||
// side module to front corner ybar
|
||||
function sideModuleTrans(t=0) =
|
||||
translate(v=[sideWallConnW,0,t-sideWallConnLugDepression])
|
||||
* yBarSideModuleConnectorTrans
|
||||
* mirror(v=[1,0,0]); // mirror for magnetModule
|
||||
|
||||
screwXBarAndYBar(at=1);
|
||||
screwXBarAndYBar(at=1);
|
||||
|
||||
multmatrix(sideModuleTrans(elevation))
|
||||
union() {
|
||||
addMagnetsToMagnetModules(at=1);
|
||||
if (!fixedSideModules) {
|
||||
multmatrix(sideModuleTrans(elevation))
|
||||
union() {
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
|
||||
addMagnetsToMagnetModules(at=1);
|
||||
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
}
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * sideModuleTrans(elevation))
|
||||
union() {
|
||||
|
||||
addMagnetsToMagnetModules(at=1);
|
||||
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
}
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans * sideModuleTrans(elevation))
|
||||
union() {
|
||||
|
||||
if (!plasticMask) {
|
||||
hingeModule();
|
||||
}
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
}
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans * sideModuleTrans(elevation))
|
||||
union() {
|
||||
if (!plasticMask) {
|
||||
hingeModule();
|
||||
}
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
}
|
||||
}
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * sideModuleTrans(elevation))
|
||||
union() {
|
||||
addMagnetsToMagnetModules(at=1);
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
}
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans * sideModuleTrans(elevation))
|
||||
union() {
|
||||
|
||||
if (!plasticMask) {
|
||||
hingeModule();
|
||||
}
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
}
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans * sideModuleTrans(elevation))
|
||||
union() {
|
||||
if (!plasticMask) {
|
||||
hingeModule();
|
||||
}
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewShort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
include <./common.scad>
|
||||
use <./slideHexNutsIntoYBar.scad>
|
||||
use <./addMagnetsToMagnetModules.scad>
|
||||
|
||||
$vpt = [116,90,18];
|
||||
$vpr = [56,0,42];
|
||||
@ -14,10 +15,22 @@ module attachXBarWithYBar(at=0) {
|
||||
|
||||
// assemble x-y bar trays
|
||||
multmatrix(translate(v = [0, 0, t]))
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
|
||||
if (fixedSideModules) {
|
||||
multmatrix(inv4x4(yBarToMagnetModuleTrans))
|
||||
addMagnetsToMagnetModules(at=1); // same as slideHexNutsIntoYBar, but the magnet has already been inserted
|
||||
} else {
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
}
|
||||
|
||||
|
||||
multmatrix(translate(v = [0, 0, t])*xBarSpaceToYBarSpace*xBarMirrorOtherCornerTrans*yBarSpaceToXBarSpace)
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
if (fixedSideModules) {
|
||||
multmatrix(inv4x4(yBarToMagnetModuleTrans))
|
||||
addMagnetsToMagnetModules(at=1);
|
||||
} else {
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
}
|
||||
|
||||
if (!plasticMask) {
|
||||
multmatrix(xBarSpaceToYBarSpace)
|
||||
|
||||
@ -33,4 +33,4 @@ module attachXYTrays(at=0,r=0) {
|
||||
}
|
||||
|
||||
propUpBottomXYTraywithSideWalls(at=1,r=r);
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,6 +56,14 @@ module mirrorAllTrayCornersFromYBarSpace() {
|
||||
|
||||
secondStackTrans = upperXYTrayTrans * mirror(v=[0,0,1]);
|
||||
|
||||
|
||||
|
||||
yBarToMagnetModuleTrans =
|
||||
translate(v=[13,0,sideWallConnLugDepression]) *
|
||||
inv4x4(yBarSideModuleConnectorTrans) *
|
||||
mirror(v=[1,0,0]);
|
||||
|
||||
|
||||
module caseScrewShort() {
|
||||
if (!screwMask) {
|
||||
color([1, 1, 1]) {
|
||||
@ -117,4 +125,4 @@ module arrow(length) {
|
||||
|
||||
cylinder(r = 1, h = length-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,8 +32,11 @@ module slideHexNutsIntoYBar(at=0)
|
||||
rotate(a=[0,90,0]);
|
||||
|
||||
module slideHexNutsOneCorner(t=0) {
|
||||
multmatrix(sideModuleTrans(t = t))
|
||||
hexNut(rackFrameScrewType);
|
||||
|
||||
if (!fixedSideModules) {
|
||||
multmatrix(sideModuleTrans(t = t))
|
||||
hexNut(rackFrameScrewType);
|
||||
}
|
||||
|
||||
multmatrix(mainRailTrans(t = t))
|
||||
hexNut(rackFrameScrewType);
|
||||
@ -49,4 +52,4 @@ module slideHexNutsIntoYBar(at=0)
|
||||
slideHexNutsOneCorner(t = t);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +52,10 @@ module connectorPositive(on, to) {
|
||||
onYBarToXBarPositive();
|
||||
} else if (on == "yBar" && to == "basePlate") {
|
||||
onYBarBasePlateConnectorPositive();
|
||||
} else if (on == "yBar" && to == "magnetModule") {
|
||||
onYBarMagnetModulePositive();
|
||||
} else if (on == "yBar" && to == "hingeModule") {
|
||||
onYBarHingeModulePositive();
|
||||
} else if (on == "basePlate" && to == "yBar") {
|
||||
onBasePlateToYBarConnectorPositive();
|
||||
} else if (on == "xBar" && to == "yBar") {
|
||||
@ -69,6 +73,8 @@ module connectorNegative(on, to) {
|
||||
onXBarToYBarNegative();
|
||||
} else if (on == "yBar" && to == "sideModule") {
|
||||
onYBarSideModuleNegative();
|
||||
} else if (on == "yBar" && to == "hingeModule") {
|
||||
onYBarHingeModuleNegative();
|
||||
} else if (on == "yBar" && to == "mainRail") {
|
||||
onYBarToMainRailNegative();
|
||||
} else if (on == "yBar" && to == "stackConnector") {
|
||||
|
||||
@ -2,13 +2,47 @@ include <../../helper/common.scad>
|
||||
include <../../config/common.scad>
|
||||
include <../sharedVariables.scad>
|
||||
include <../side/sideWallVariables.scad>
|
||||
include <../side/magnetModule.scad>
|
||||
include <../side/hingeModule.scad>
|
||||
|
||||
module onYBarSideModuleNegative() {
|
||||
|
||||
module onYBarSideModuleNegative(fixed=false) {
|
||||
|
||||
translate(v = [-xySlack/2, -xySlack/2, -sideWallConnLugDepression])
|
||||
cube(size = [sideWallConnW+xySlack, sideWallConnD+xySlack, sideWallConnLugDepression]);
|
||||
|
||||
translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, -(4+sideWallConnLugDepression)])
|
||||
rotate(a=[0,0,90])
|
||||
hexNutPocket_N("m3", openSide=false, backSpace=5, bridgeFront=true);
|
||||
}
|
||||
|
||||
if (!fixed) {
|
||||
translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, -(4+sideWallConnLugDepression)])
|
||||
rotate(a=[0,0,90])
|
||||
hexNutPocket_N("m3", openSide=false, backSpace=5, bridgeFront=true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module onYBarMagnetModulePositive() {
|
||||
|
||||
|
||||
translate(v=[sideWallConnW,0,-sideWallConnLugDepression])
|
||||
mirror(v=[1,0,0])
|
||||
magnetModule(fixed=true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
module onYBarHingeModulePositive() {
|
||||
|
||||
translate(v=[sideWallConnW,0,-sideWallConnLugDepression])
|
||||
mirror(v=[1,0,0])
|
||||
hingeModule(fixed=false);
|
||||
}
|
||||
|
||||
module onYBarHingeModuleNegative() {
|
||||
|
||||
translate(v=[sideWallConnW,0,-sideWallConnLugDepression])
|
||||
mirror(v=[1,0,0])
|
||||
difference() {
|
||||
cube(size=[sideWallConnW,sideWallConnD,sideWallConnLugDepression]);
|
||||
hingeModule(fixed=true);
|
||||
}
|
||||
}
|
||||
|
||||
7
rack/print/yBarRight_P.scad
Normal file
7
rack/print/yBarRight_P.scad
Normal file
@ -0,0 +1,7 @@
|
||||
use <../yBar.scad>
|
||||
|
||||
// Oriented for 3d printing.
|
||||
// Supports required at XY wall connections, and depending on roundness
|
||||
|
||||
mirror(v=[1,0,0])
|
||||
yBar();
|
||||
@ -3,18 +3,18 @@ include <../../config/common.scad>
|
||||
include <../sharedVariables.scad>
|
||||
include <./sideWallVariables.scad>
|
||||
|
||||
hingeModule();
|
||||
|
||||
module hingeModule() {
|
||||
module hingeModule(fixed=false) {
|
||||
|
||||
applyHingePole()
|
||||
applyYBarScrewMount()
|
||||
applyYBarScrewMount(fixed)
|
||||
base();
|
||||
|
||||
connW = sideWallConnW;
|
||||
connD = sideWallConnD;
|
||||
|
||||
module base() {
|
||||
|
||||
connW = sideWallConnW;
|
||||
connD = sideWallConnD;
|
||||
|
||||
intersection() {
|
||||
|
||||
union() {
|
||||
@ -57,10 +57,13 @@ module hingeModule() {
|
||||
}
|
||||
|
||||
|
||||
module applyYBarScrewMount() {
|
||||
module applyYBarScrewMount(fixed=false) {
|
||||
apply_n() {
|
||||
translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression])
|
||||
counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10);
|
||||
|
||||
if (!fixed) {
|
||||
translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression])
|
||||
counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10);
|
||||
}
|
||||
|
||||
children(0);
|
||||
}
|
||||
|
||||
@ -4,20 +4,19 @@ include <../sharedVariables.scad>
|
||||
include <./sideWallVariables.scad>
|
||||
|
||||
|
||||
magnetModule();
|
||||
module magnetModule(fixed=false) {
|
||||
|
||||
module magnetModule() {
|
||||
|
||||
applyYBarScrewMount()
|
||||
applyYBarScrewMount(fixed)
|
||||
applyMagnetMount()
|
||||
base();
|
||||
|
||||
connW = sideWallConnW;
|
||||
connD = sideWallConnD;
|
||||
|
||||
module base() {
|
||||
|
||||
connW = sideWallConnW;
|
||||
connD = sideWallConnD;
|
||||
|
||||
intersection() {
|
||||
|
||||
cube(size = [connW, connD, sideWallConnLugDepression]);
|
||||
|
||||
// TODO: pattern for this? beef up mirror4XY?
|
||||
@ -29,10 +28,14 @@ module magnetModule() {
|
||||
}
|
||||
}
|
||||
|
||||
module applyYBarScrewMount() {
|
||||
module applyYBarScrewMount(fixed=false) {
|
||||
|
||||
apply_n() {
|
||||
translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression])
|
||||
counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10);
|
||||
|
||||
if (!fixed) {
|
||||
translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge, sideWallConnLugDepression])
|
||||
counterSunkHead_N(rackFrameScrewType, headExtension = eps, screwExtension = inf10);
|
||||
}
|
||||
|
||||
children(0);
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ module yBar() {
|
||||
|
||||
applyOnYBarBothCorners(to="basePlate", trans=yBarBasePlateConnectorTrans)
|
||||
applyOnYBarBothCorners(to="stackConnector", trans=yBarStackConnectorTrans)
|
||||
applyOnYBarBothCorners(to="sideModule", trans=yBarSideModuleConnectorTrans)
|
||||
applySideModules()
|
||||
applyOnYBarBothCorners(to="mainRail", trans=yBarMainRailConnectorTrans)
|
||||
applyOnYBarBothCorners(to="xBar", trans=yBarXBarConnectorTrans)
|
||||
yBarBase();
|
||||
@ -33,4 +33,20 @@ module yBar() {
|
||||
applyConnector(on="yBar", to=to, trans=yBarMirrorOtherCornerTrans * trans)
|
||||
children(0);
|
||||
}
|
||||
|
||||
|
||||
module applySideModules() {
|
||||
|
||||
if (!fixedSideModules) {
|
||||
applyOnYBarBothCorners(to="sideModule", trans=yBarSideModuleConnectorTrans)
|
||||
children(0);
|
||||
|
||||
} else {
|
||||
|
||||
applyConnector(on="yBar", to="magnetModule", trans=yBarSideModuleConnectorTrans)
|
||||
applyConnector(on="yBar", to="hingeModule", trans=yBarMirrorOtherCornerTrans * yBarSideModuleConnectorTrans)
|
||||
children(0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user