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

@ -0,0 +1,55 @@
use <./tray.scad>
/*
Parametric rack-mount tray:
Dimensions can be adjusted using the variables below. You can also add mounting holes to fasten things that have
screw holes at the bottom.
!!! Please also make sure that the correct rack frame preset is set in rackFrame.scad !!!
*/
// begin config ////////////////////////////////////////////////////////////////////////////////////////////////////////
trayU = 2;
baseWidth = 145;
baseDepth = 100;
baseThickness = 3; // tray bottom thickness
frontThickness = 3; // front plate thickness
sideThickness = 3;
backLipHeight = 2;
frontLipHeight = 2;
sideSupport = true;
trayLeftPadding = 10; // extra space between the left rail and tray. configure this to move the tray left/right.
mountPointType = "m3";
mountPointElevation = 1; // basically standoff height
// add/config standoff coordinates here. Format is [[x,y]]
mountPoints = [
[30,10],
[30+75,10],
[30,10+75],
[30+75,10+75],
];
// end config //////////////////////////////////////////////////////////////////////////////////////////////////////////
bottomScrewTray(
u=trayU,
trayWidth=baseWidth,
trayDepth=baseDepth,
trayThickness=baseThickness,
frontLipHeight=frontLipHeight,
backLipHeight=backLipHeight,
mountPoints=mountPoints,
frontThickness=frontThickness,
sideThickness=sideThickness,
mountPointElevation=mountPointElevation,
mountPointType=mountPointType,
sideSupport=sideSupport,
trayLeftPadding=trayLeftPadding
);

87
rack-mount/tray/tray.scad Normal file
View File

@ -0,0 +1,87 @@
include <../common.scad>
use <../rackEars.scad>
/*
Parametric rack-mount tray -
Please see ./entry.scad for configuring/printing
Please also make sure that the correct rack frame preset is set in rackFrame.scad.
*/
module bottomScrewTray(u, trayWidth, trayDepth, trayThickness, mountPoints, mountPointElevation, mountPointType, frontThickness, sideThickness, frontLipHeight, backLipHeight, trayLeftPadding, sideSupport=true) {
lipThickness = sideThickness;
screwDx = rackMountScrewWidth; // x dist between the mount holes
screwDz = uDiff * u;
plateLength = screwDx + 2*rackMountScrewXDist;
plateHeight = screwDz + 2*rackMountScrewZDist;
minScrewToTraySpacing = railScrewHoleToInnerEdge;
leftScrewDistToTray = minScrewToTraySpacing + trayLeftPadding;
leftScrewGlobalX = -leftScrewDistToTray;
rightScrewGlobalX = screwDx + leftScrewGlobalX;
// check (tray width)+(configured extra space) fits within the rack
assert(trayWidth <= screwDx-(2*minScrewToTraySpacing + trayLeftPadding));
difference() {
applyMountHoles()
translate(v = [-sideThickness, -frontThickness, -trayThickness])
body();
}
module body() {
// base
cube(size = [trayWidth, trayDepth, trayThickness]);
// front lip
translate(v = [0, 0, trayThickness])
cube(size = [trayWidth, lipThickness, frontLipHeight]);
// back lip
translate(v = [0, trayDepth-lipThickness, trayThickness])
cube(size = [trayWidth, lipThickness, backLipHeight]);
translate(v = [leftScrewGlobalX, 0, rackMountScrewZDist])
rackEarModule(frontThickness = frontThickness, sideThickness = sideThickness, frontWidth =
leftScrewDistToTray+rackMountScrewXDist+sideThickness, sideDepth = trayDepth-lipThickness, u = u, backPlaneHeight=trayThickness+backLipHeight, support=sideSupport);
translate(v = [rightScrewGlobalX, 0, rackMountScrewZDist])
mirror(v = [1, 0, 0])
rackEarModule(frontThickness = frontThickness, sideThickness = sideThickness, frontWidth =
rightScrewGlobalX-trayWidth+rackMountScrewXDist+sideThickness, sideDepth = trayDepth-lipThickness, u = u, backPlaneHeight=trayThickness+backLipHeight, support=sideSupport);
}
module applyMountHoles() {
mountPointPosThickness = 2;
apply_pn() {
for (i = [0:len(mountPoints)-1]) {
x = mountPoints[i][0];
y = mountPoints[i][1];
translate(v=[x, y, 0])
cylinder(r=screwRadiusSlacked(mountPointType)+mountPointPosThickness, h=mountPointElevation);
}
for (i = [0:len(mountPoints)-1]) {
x = mountPoints[i][0];
y = mountPoints[i][1];
translate(v=[x, y, -trayThickness])
mirror(v=[0,0,1])
counterSunkHead_N(mountPointType, inf, inf);
}
children(0);
}
}
}