Improve rack-mount. Individual rack-mount systems are now organized in their own directories, with a standard entry.scad file.

This commit is contained in:
zhao
2023-08-31 00:20:12 -04:00
parent 3167feea03
commit 658fcf9948
67 changed files with 186 additions and 191 deletions

View File

@ -1,53 +0,0 @@
include <../../rack/sharedVariables.scad>
include <../common.scad>
use <../sideRail.scad>
use <../frontBoxHolder.scad>
/*
(WIP) Enclosed box mounting system:
Helper file to use semi-enclosed side rails and a front plate to mount a box.
This system does not require any mounting holes for the enclosed box.
!!! Please also make sure that the correct rack frame preset is set in rackFrame.scad !!!
*/
// begin config ////////////////////////////////////////////////////////////////////////////////////////////////////////
boxWidth = 160;
boxHeight = 27;
boxDepth = 100;
railDefaultThickness = 1.2;
zOrientation = "middle";
// Does not affect any part dimensions. Set this to true to visualize how a box wound be mounted.
visualize = true;
// end config //////////////////////////////////////////////////////////////////////////////////////////////////////////
#cube(size=[boxWidth, boxDepth, boxHeight]);
sideSupportRailBase(top=true, defaultThickness=railDefaultThickness, supportedZ=boxHeight, supportedY=boxDepth, supportedX=boxWidth, zOrientation=zOrientation);
translate(v=[boxWidth,0,0])
mirror(v=[1,0,0])
sideSupportRailBase(top=true, defaultThickness=railDefaultThickness, supportedZ=boxHeight, supportedY=boxDepth, supportedX=boxWidth, zOrientation=zOrientation);
translate(v=[0,0,10])
rotate(a=[-90,0,0])
*frontBoxHolder(
u=2,
plateThickness=3,
cutoutOffsetX=(rackMountScrewWidth-147)/2,
cutoutOffsetY=4.25,
cutoutX=147,
cutoutY=21.5,
support=true,
supportedZ=boxHeight,
supportWidth=120,
supportDepth=5,
supportRailBaseThickness=1.75
);

View File

@ -0,0 +1,65 @@
include <../../rack/sharedVariables.scad>
include <../common.scad>
include <./helper.scad>
use <./sideRail.scad>
use <./frontBoxHolder.scad>
/*
Enclosed box mounting system:
Helper file to use semi-enclosed side rails and a front plate to mount a box.
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
*/
// begin config ////////////////////////////////////////////////////////////////////////////////////////////////////////
// Does not affect any part dimensions. Set this to true to visualize how a box would be mounted.
visualize = false;
boxWidth = 170;
boxHeight = 27.0;
boxDepth = 100;
railDefaultThickness = 1.5;
railSideThickness = 3;
frontPlateThickness = 3;
frontPlateCutoutYSpace = 3;
frontPlateCutoutXSpace = 5;
zOrientation = "middle"; // or "bottom"
// 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]);
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]);
}
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
);

View File

@ -0,0 +1,40 @@
include <../common.scad>
include <./helper.scad>
use <../plateBase.scad>
// To be used with closed sideRails to fully encapsulate a box
module frontBoxHolder(plateThickness=3, cutoutOffsetX, cutoutOffsetY, cutoutX, cutoutY, supportedZ, supportWidth, supportDepth=5, supportRailDefaultThickness, zOrientation) {
//assert(supportedZ + 2*supportThickness <= boxPlateScrewToYEdge*2 + u*uDiff);
//assert(supportWidth < rackMountScrewWidth); // not tight, need to include screw radii
u = findU(supportedZ, supportRailDefaultThickness);
supportRailBottomThickness = railBottomThickness(u, supportedZ, supportRailDefaultThickness, zOrientation);
difference() {
union() {
plateBase(U=u, plateThickness=plateThickness, screwToXEdge=boxPlateScrewToXEdge, screwToYEdge=boxPlateScrewToYEdge, screwType=mainRailScrewType, filletR=2);
// bottom support
translate(v=[(rackMountScrewWidth-supportWidth)/2, -boxPlateScrewToYEdge,0])
cube(size=[supportWidth, supportRailBottomThickness, supportDepth]);
// top support
translate(v=[(rackMountScrewWidth-supportWidth)/2, -boxPlateScrewToYEdge+supportRailBottomThickness+supportedZ,0])
cube(size=[supportWidth, supportRailDefaultThickness, supportDepth]);
}
union() {
translate(v=[cutoutOffsetX, cutoutOffsetY-boxPlateScrewToYEdge,-inf/2])
minkowski() {
r=2;
cylinder(r=r,h=inf);
translate(v=[r, r, 0])
cube(size = [cutoutX-2*r, cutoutY-2*r, inf]);
}
}
}
}

View File

@ -0,0 +1,21 @@
include <../common.scad>
// Some utility functions, as well as global functions to make code cleaner
sideRailLowerMountPointToBottom = uDiff/2;
sideRailBaseWidth = 15;
// distance between front and back main rail screw mounts
sideRailScrewMountDist = yBarDepth - 2*(frontScrewSpacing + railFrontThickness + railSlotToXZ);
boxPlateScrewToXEdge = 4.5; // wow these are named poorly
boxPlateScrewToYEdge = 5;
function findU(boxHeight, minRailThickness) = max(1, ceil((boxHeight + 2*minRailThickness)/uDiff) - 1);
function railBottomThickness(u, boxHeight, minRailThickness, zOrientation) =
(zOrientation == "middle")
? (((u+1) * uDiff) - boxHeight)/2
: (zOrientation == "bottom")
? minRailThickness
: minRailThickness;

View File

@ -1,33 +1,20 @@
include <../helper/common.scad>
include <../config/common.scad>
include <../rack/sharedVariables.scad>
include <./common.scad>
include <../common.scad>
include <./helper.scad>
//sideSupportRailBase(top=true, defaultThickness=1.5, supportedZ=27.2, supportedY=101.5, supportedX=159);
// distance between front and back main rail screw mounts
sideRailScrewMountDist = yBarDepth - 2*(frontScrewSpacing + railFrontThickness + railSlotToXZ);
module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrientation="middle", defaultThickness=2) {
module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrientation="middle", defaultThickness=2, railSideThickness=4) {
mountBlockHeight = 10;
mountBlockDepth = 10;
screwMountGlobalDz = screwDiff / 2.0; // vertical distance between local origin and main rail screw mount
sideRailScrewToMainRailFrontDx = frontScrewSpacing+railFrontThickness;
railLength = max(sideRailScrewMountDist + sideRailScrewToMainRailFrontDx + mountBlockDepth/2, supportedY+defaultThickness);
railBaseThickness = defaultThickness; // default thickness value
railSideThickness = 4;
railBackThickness = 3;
railBaseWidth = 15;
// Minimum U to enclose box, while also have a minimum defaultThickness for top and bottom.
minU = max(1, ceil((supportedZ + 2*railBaseThickness) / uDiff)-1);
railBottomThickness =
(zOrientation == "middle")
? (((minU+1) * uDiff) - supportedZ)/2
: (zOrientation == "bottom")
? railBaseThickness
: railBaseThickness;
u = findU(supportedZ, railBaseThickness);
railBottomThickness = railBottomThickness(u, supportedZ, railBaseThickness, zOrientation);
assert(supportedX <= maxUnitWidth);
assert (zOrientation == "middle" || zOrientation == "bottom", "Z-Orientation not supported");
@ -43,7 +30,7 @@ module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrient
module applyMainRailMounts() {
mountBlockExtension = (railSupportsDx - supportedX)/2 - railSideThickness;
minHexNutPocketToXYDist = mountBlockHeight/2;
minHexNutPocketToXYDist = sideRailLowerMountPointToBottom;
minHexNutPocketToXZDist = mountBlockDepth/2;
minHexNutPocketToYZDist = 4;
screwU = floor((railSideHeight) / uDiff)-1;
@ -92,22 +79,22 @@ module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrient
difference () {
union() {
cube(size = [railBaseWidth, railLength, railBottomThickness]);
cube(size = [sideRailBaseWidth, railLength, railBottomThickness]);
cube(size = [railSideThickness, railLength, railSideHeight]);
// back support
translate(v = [0, max(railLength-railBackThickness, supportedY), 0])
cube(size = [railBaseWidth, railBackThickness, railSideHeight]);
cube(size = [sideRailBaseWidth, railBackThickness, railSideHeight]);
// back support for box
translate(v = [0, supportedY, 0])
cube(size = [railBaseWidth, railBackThickness, railSideHeight]);
cube(size = [sideRailBaseWidth, railBackThickness, railSideHeight]);
// top support
if (top) {
translate(v = [0, 0, railSideHeight-railBaseThickness])
cube(size = [railBaseWidth, railLength, railBaseThickness]);
cube(size = [sideRailBaseWidth, railLength, railBaseThickness]);
}
}
@ -140,7 +127,7 @@ module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrient
}
}
cylindricalFiletNegative(p0=[railBaseWidth,0,0],p1=[railBaseWidth,0,inf], n=[1,-1,0],r=r);
cylindricalFiletNegative(p0=[sideRailBaseWidth,0,0],p1=[sideRailBaseWidth,0,inf], n=[1,-1,0],r=r);
}
}
}

View File

@ -1,55 +0,0 @@
// To be used with closed sideRails to fully encapsulate a box
include <../config/common.scad>
include <../helper/common.scad>
include <./common.scad>
use <./plateBase.scad>
frontBoxHolder(u=2, plateThickness=3, cutoutOffsetX=20, cutoutOffsetY=2, cutoutX=147, cutoutY=26,
support=true, supportedZ = 27.5, supportWidth=120, supportDepth=5, supportRailBaseThickness=1.25);
module frontBoxHolder(u, plateThickness=3, cutoutOffsetX, cutoutOffsetY, cutoutX, cutoutY, support=false, supportedZ, supportWidth, supportDepth, bottomSupportThickness = 2, supportRailBaseThickness = 2) {
plateScrewToXEdge = 4.5; // wow these are named poorly
plateScrewToYEdge = 5;
if (support) {
//assert(supportedZ + 2*supportThickness <= plateScrewToYEdge*2 + u*uDiff);
//assert(supportWidth < rackMountScrewWidth); // not tight, need to include screw radii
}
difference() {
union() {
plateBase(U=u, plateThickness=plateThickness, screwToXEdge=plateScrewToXEdge, screwToYEdge=plateScrewToYEdge, screwType=mainRailScrewType, filletR=2);
if (support) {
bottomSuportThickness = supportRailBaseThickness;
translate(v=[(rackMountScrewWidth-supportWidth)/2, -plateScrewToYEdge,0])
cube(size=[supportWidth, bottomSuportThickness, supportDepth]);
translate(v=[(rackMountScrewWidth-supportWidth)/2, (-plateScrewToYEdge+bottomSuportThickness) + supportedZ,0])
cube(size=[supportWidth, bottomSuportThickness, supportDepth]);
}
}
union() {
translate(v=[cutoutOffsetX, cutoutOffsetY-plateScrewToYEdge,-inf/2])
minkowski() {
r=2;
cylinder(r=r,h=inf);
translate(v=[r, r, 0])
cube(size = [cutoutX-2*r, cutoutY-2*r, inf]);
}
}
}
}

View File

@ -0,0 +1,18 @@
use <./patchPanel.scad>
/*
Parametric patch panel -
Please also make sure that the correct rack frame preset is set in rackFrame.scad.
TODO add support for 2d arrays
*/
// begin config ////////////////////////////////////////////////////////////////////////////////////////////////////////
numSlots = 8;
// end config //////////////////////////////////////////////////////////////////////////////////////////////////////////
mirror(v=[0,0,1])
patchPanel(slots=numSlots);

View File

@ -1,9 +1,12 @@
include <../config/common.scad>
include <../helper/common.scad>
include <../rack/sharedVariables.scad>
use <./plateBase.scad>
include <../common.scad>
use <../plateBase.scad>
/*
Parametric patch panel -
Please see ./entry.scad for configuring/printing
Please also make sure that the correct rack frame preset is set in rackFrame.scad.
*/
*patchPanel(slots=2);
module patchPanel (slots=8) {

View File

@ -1,16 +0,0 @@
include <../../rack/sharedVariables.scad>
use <../frontBoxHolder.scad>
frontBoxHolder(
u=2,
plateThickness=3,
cutoutOffsetX=(rackMountScrewWidth-147)/2,
cutoutOffsetY=4.25,
cutoutX=147,
cutoutY=21.5,
support=true,
supportedZ = 26.5,
supportWidth=120,
supportDepth=5,
supportRailBaseThickness=1.75
);

View File

@ -1,5 +0,0 @@
use <../patchPanel.scad>
mirror(v=[0,0,1])
patchPanel(slots=8);

View File

@ -1,3 +0,0 @@
use <../sideRail.scad>
sideSupportRailBase(top=true, defaultThickness=1.4, supportedZ=27.2, supportedY=101.5, supportedX=159);

View File

@ -1,4 +0,0 @@
use <../sideRail.scad>
mirror(v=[1,0,0])
sideSupportRailBase(top=true, defaultThickness=1.4, supportedZ=27.2, supportedY=101.5, supportedX=159);

View File

@ -1,4 +1,4 @@
use <../tray.scad>
use <./tray.scad>
/*
Parametric rack-mount tray:

View File

@ -1,9 +1,9 @@
include <./common.scad>
use <./rackEars.scad>
include <../common.scad>
use <../rackEars.scad>
/*
Parametric rack-mount tray -
Please see print/tray_P.scad for configuring/printing
Please see ./entry.scad for configuring/printing
Please also make sure that the correct rack frame preset is set in rackFrame.scad.
*/