further work on rack-mount refactor

This commit is contained in:
zhao
2023-09-01 15:30:16 -04:00
parent 658fcf9948
commit be3020cbb1
10 changed files with 194 additions and 92 deletions

View File

@ -11,55 +11,64 @@ use <./frontBoxHolder.scad>
This system does not require any mounting holes on the enclosed box.
!!! Please also make sure that the correct rack frame preset is set in rackFrame.scad !!!
TODO support full box (so for the micro profile it would be 180) this may require widening the main rail
*/
module enclosedBoxSystem (
// begin config ////////////////////////////////////////////////////////////////////////////////////////////////////////
// Does not affect any part dimensions. Set this to true to visualize how a box would be mounted.
visualize = false;
visualize = false,
zOrientation = "middle", // ["middle" | "bottom"]
recessSideRail = false,
boxWidth = 170;
boxHeight = 27.0;
boxDepth = 100;
boxWidth = 170,
boxHeight = 27,
boxDepth = 100,
railDefaultThickness = 1.5;
railSideThickness = 3;
railDefaultThickness = 1.5,
railSideThickness = 3,
frontPlateThickness = 3;
frontPlateCutoutYSpace = 3;
frontPlateCutoutXSpace = 5;
zOrientation = "middle"; // or "bottom"
frontPlateThickness = 3,
frontPlateCutoutYSpace = 3,
frontPlateCutoutXSpace = 5,
// end config //////////////////////////////////////////////////////////////////////////////////////////////////////////
) {
leftRailTrans = identity;
rightRailTrans = visualize
? translate(v = [boxWidth, 0, 0])*mirror(v = [1, 0, 0])
: translate(v = [sideRailBaseWidth*2, 0, 0])*mirror(v = [1, 0, 0]);
leftRailTrans = identity;
rightRailTrans = visualize
? translate(v=[boxWidth,0,0]) * mirror(v=[1,0,0])
: translate(v=[sideRailBaseWidth*2,0,0]) * mirror(v=[1,0,0]);
u = findU(boxHeight, railDefaultThickness);
railBottomThickness = railBottomThickness(u, boxHeight, railDefaultThickness, zOrientation);
frontBoxHolderTrans = visualize
? translate(v = [railSideThickness-(railSupportsDx-boxWidth)/2, 0, sideRailLowerMountPointToBottom-
railBottomThickness])*mirror(v = [0, 1, 0])*rotate(a = [90, 0, 0])
: mirror(v = [0, 1, 0])*translate(v = [0, uDiff, frontPlateThickness-railBottomThickness]);
u = findU(boxHeight, railDefaultThickness);
railBottomThickness = railBottomThickness(u, boxHeight, railDefaultThickness, zOrientation);
frontBoxHolderTrans = visualize
? translate(v=[railSideThickness-(railSupportsDx-boxWidth)/2,0, sideRailLowerMountPointToBottom-railBottomThickness]) * mirror(v=[0,1,0]) * rotate(a=[90,0,0])
: mirror(v=[0,1,0]) * translate(v=[0,uDiff,frontPlateThickness - railBottomThickness]);
if (visualize) {
%cube(size = [boxWidth, boxDepth, boxHeight]);
}
if (visualize) {
%cube(size = [boxWidth, boxDepth, boxHeight]);
multmatrix(leftRailTrans)
sideSupportRailBase(top = true, recess = recessSideRail, defaultThickness = railDefaultThickness, supportedZ =
boxHeight, supportedY = boxDepth, supportedX = boxWidth, zOrientation = zOrientation, railSideThickness =
railSideThickness);
multmatrix(rightRailTrans)
sideSupportRailBase(top = true, recess = recessSideRail, defaultThickness = railDefaultThickness, supportedZ =
boxHeight, supportedY = boxDepth, supportedX = boxWidth, zOrientation = zOrientation, railSideThickness =
railSideThickness);
multmatrix(frontBoxHolderTrans)
frontBoxHolder(
cutoutOffsetX = (rackMountScrewWidth-(boxWidth-2*frontPlateCutoutXSpace))/2, cutoutOffsetY = railBottomThickness+
frontPlateCutoutYSpace,
cutoutX = boxWidth-2*frontPlateCutoutXSpace, cutoutY = boxHeight-2*frontPlateCutoutYSpace,
zOrientation = zOrientation, supportedZ = boxHeight, supportWidth = max(10, boxWidth-(sideRailBaseWidth+10)),
supportRailDefaultThickness = railDefaultThickness, plateThickness = frontPlateThickness
);
}
multmatrix(leftRailTrans)
sideSupportRailBase(top=true, defaultThickness=railDefaultThickness, supportedZ=boxHeight, supportedY=boxDepth, supportedX=boxWidth, zOrientation=zOrientation, railSideThickness=railSideThickness);
multmatrix(rightRailTrans)
sideSupportRailBase(top=true, defaultThickness=railDefaultThickness, supportedZ=boxHeight, supportedY=boxDepth, supportedX=boxWidth, zOrientation=zOrientation, railSideThickness=railSideThickness);
multmatrix(frontBoxHolderTrans)
frontBoxHolder(
cutoutOffsetX=(rackMountScrewWidth-(boxWidth-2*frontPlateCutoutXSpace))/2, cutoutOffsetY=railBottomThickness+frontPlateCutoutYSpace,
cutoutX=boxWidth-2*frontPlateCutoutXSpace, cutoutY=boxHeight-2*frontPlateCutoutYSpace,
zOrientation = zOrientation, supportedZ=boxHeight, supportWidth=max(10, boxWidth-(sideRailBaseWidth+10)), supportRailDefaultThickness = railDefaultThickness, plateThickness=frontPlateThickness
);
enclosedBoxSystem();