further work on rack-mount refactor
This commit is contained in:
21
rack-mount/enclosed-box/animate.scad
Normal file
21
rack-mount/enclosed-box/animate.scad
Normal file
@ -0,0 +1,21 @@
|
||||
use <./entry.scad>
|
||||
|
||||
$vpt = [120,-30,63];
|
||||
$vpr = [74,0,25];
|
||||
$vpd = 550;
|
||||
$vpf = 22.50;
|
||||
|
||||
animateEnclosedBoxSystem(at=$t);
|
||||
|
||||
module animateEnclosedBoxSystem(at=$t) {
|
||||
|
||||
zOrientation = "middle";
|
||||
x=150;
|
||||
y=70;
|
||||
z=20;
|
||||
dx = abs(lerp(a=-20, b=20, t=at));
|
||||
dy = abs(lerp(a=-50, b=50, t=at));
|
||||
dz = abs(lerp(a=-15, b=15, t=at));
|
||||
|
||||
enclosedBoxSystem(visualize=true, zOrientation=zOrientation, boxWidth=x+dx, boxDepth=y+dy, boxHeight=z+dz);
|
||||
}
|
||||
@ -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();
|
||||
@ -4,7 +4,7 @@ include <./helper.scad>
|
||||
//sideSupportRailBase(top=true, defaultThickness=1.5, supportedZ=27.2, supportedY=101.5, supportedX=159);
|
||||
|
||||
|
||||
module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrientation="middle", defaultThickness=2, railSideThickness=4) {
|
||||
module sideSupportRailBase(top=true, recess=false, supportedZ, supportedY, supportedX, zOrientation="middle", defaultThickness=2, railSideThickness=4) {
|
||||
|
||||
mountBlockDepth = 10;
|
||||
screwMountGlobalDz = screwDiff / 2.0; // vertical distance between local origin and main rail screw mount
|
||||
@ -16,12 +16,14 @@ module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrient
|
||||
u = findU(supportedZ, railBaseThickness);
|
||||
railBottomThickness = railBottomThickness(u, supportedZ, railBaseThickness, zOrientation);
|
||||
|
||||
assert(supportedX <= maxUnitWidth);
|
||||
assert(supportedX <= maxUnitWidth, "Configured supported width is too high for rack profile");
|
||||
assert (zOrientation == "middle" || zOrientation == "bottom", "Z-Orientation not supported");
|
||||
assert(railBottomThickness >= railBaseThickness);
|
||||
// require recessed rail if supportedX is close to maxUnitWidth
|
||||
assert(recess || (supportedX+2*railSideThickness <= maxUnitWidth), "Configured supported width requires recessed side rail.");
|
||||
|
||||
railSideHeight = supportedZ + railBaseThickness + railBottomThickness + overhangSlack;
|
||||
frontMountPad = (sideRailScrewToMainRailFrontDx-mountBlockDepth/2)-xySlack;
|
||||
frontMountPad = (sideRailScrewToMainRailFrontDx-mountBlockDepth/2);
|
||||
|
||||
translate(v=[-railSideThickness, 0, -railBottomThickness])
|
||||
applyMainRailMounts()
|
||||
@ -127,7 +129,12 @@ module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrient
|
||||
}
|
||||
}
|
||||
|
||||
cylindricalFiletNegative(p0=[sideRailBaseWidth,0,0],p1=[sideRailBaseWidth,0,inf], n=[1,-1,0],r=r);
|
||||
frontCutTrans = recess ? translate(v=[0,frontMountPad,0]): translate(v=[0,xySlack,0]);
|
||||
multmatrix(frontCutTrans) {
|
||||
cylindricalFiletNegative(p0=[sideRailBaseWidth,0,0],p1=[sideRailBaseWidth,0,inf], n=[1,-1,0],r=r);
|
||||
halfspace(vpos=[0,-1,0], p=[0,0,0]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user