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:
@ -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
|
||||
);
|
||||
65
rack-mount/enclosed-box/entry.scad
Normal file
65
rack-mount/enclosed-box/entry.scad
Normal 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
|
||||
);
|
||||
40
rack-mount/enclosed-box/frontBoxHolder.scad
Normal file
40
rack-mount/enclosed-box/frontBoxHolder.scad
Normal 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]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
21
rack-mount/enclosed-box/helper.scad
Normal file
21
rack-mount/enclosed-box/helper.scad
Normal 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;
|
||||
138
rack-mount/enclosed-box/sideRail.scad
Normal file
138
rack-mount/enclosed-box/sideRail.scad
Normal file
@ -0,0 +1,138 @@
|
||||
include <../common.scad>
|
||||
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) {
|
||||
|
||||
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
|
||||
railBackThickness = 3;
|
||||
// Minimum U to enclose box, while also have a minimum defaultThickness for top and bottom.
|
||||
u = findU(supportedZ, railBaseThickness);
|
||||
railBottomThickness = railBottomThickness(u, supportedZ, railBaseThickness, zOrientation);
|
||||
|
||||
assert(supportedX <= maxUnitWidth);
|
||||
assert (zOrientation == "middle" || zOrientation == "bottom", "Z-Orientation not supported");
|
||||
assert(railBottomThickness >= railBaseThickness);
|
||||
|
||||
railSideHeight = supportedZ + railBaseThickness + railBottomThickness + overhangSlack;
|
||||
frontMountPad = (sideRailScrewToMainRailFrontDx-mountBlockDepth/2)-xySlack;
|
||||
|
||||
translate(v=[-railSideThickness, 0, -railBottomThickness])
|
||||
applyMainRailMounts()
|
||||
sideSupportRailBase();
|
||||
|
||||
module applyMainRailMounts() {
|
||||
|
||||
mountBlockExtension = (railSupportsDx - supportedX)/2 - railSideThickness;
|
||||
minHexNutPocketToXYDist = sideRailLowerMountPointToBottom;
|
||||
minHexNutPocketToXZDist = mountBlockDepth/2;
|
||||
minHexNutPocketToYZDist = 4;
|
||||
screwU = floor((railSideHeight) / uDiff)-1;
|
||||
|
||||
apply_pn() {
|
||||
mountBlockPositive();
|
||||
mountBlockNegative();
|
||||
children(0);
|
||||
}
|
||||
|
||||
module mountBlockPositive() {
|
||||
translate(v = [0, frontMountPad, 0])
|
||||
singleMountBlockPositive();
|
||||
translate(v=[0,frontMountPad+sideRailScrewMountDist, 0])
|
||||
singleMountBlockPositive();
|
||||
}
|
||||
|
||||
module mountBlockNegative() {
|
||||
translate(v = [0, frontMountPad, 0])
|
||||
singleMountBlockNegative();
|
||||
translate(v=[0,frontMountPad+sideRailScrewMountDist, 0])
|
||||
singleMountBlockNegative();
|
||||
}
|
||||
|
||||
module singleMountBlockPositive() {
|
||||
translate(v = [-mountBlockExtension, 0, 0])
|
||||
cube(size = [mountBlockExtension, mountBlockDepth, railSideHeight]);
|
||||
}
|
||||
|
||||
module singleMountBlockNegative() {
|
||||
nutPocket();
|
||||
|
||||
translate(v = [0, 0, uDiff*screwU])
|
||||
nutPocket();
|
||||
|
||||
module nutPocket() {
|
||||
translate(v=[-mountBlockExtension+minHexNutPocketToYZDist, minHexNutPocketToXZDist, minHexNutPocketToXYDist])
|
||||
rotate(a=[-90,0,90])
|
||||
hexNutPocket_N(rackFrameScrewType, openSide=false, backSpace=min((railSideThickness-1)+mountBlockExtension-minHexNutPocketToYZDist,15));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module sideSupportRailBase() {
|
||||
|
||||
difference () {
|
||||
union() {
|
||||
cube(size = [sideRailBaseWidth, railLength, railBottomThickness]);
|
||||
|
||||
cube(size = [railSideThickness, railLength, railSideHeight]);
|
||||
|
||||
// back support
|
||||
translate(v = [0, max(railLength-railBackThickness, supportedY), 0])
|
||||
cube(size = [sideRailBaseWidth, railBackThickness, railSideHeight]);
|
||||
|
||||
// back support for box
|
||||
translate(v = [0, supportedY, 0])
|
||||
cube(size = [sideRailBaseWidth, railBackThickness, railSideHeight]);
|
||||
|
||||
// top support
|
||||
if (top) {
|
||||
translate(v = [0, 0, railSideHeight-railBaseThickness])
|
||||
cube(size = [sideRailBaseWidth, railLength, railBaseThickness]);
|
||||
}
|
||||
}
|
||||
|
||||
union() {
|
||||
distanceFromSeparator = 3;
|
||||
r = 4;
|
||||
|
||||
ventDy1 = frontMountPad+mountBlockDepth+distanceFromSeparator;
|
||||
ventY1 = min(supportedY-(ventDy1+distanceFromSeparator), sideRailScrewMountDist-(2*distanceFromSeparator+mountBlockDepth));
|
||||
|
||||
ventDy2 = max(ventDy1, supportedY+railBackThickness+distanceFromSeparator);
|
||||
ventY2 = max(0, railLength - (ventDy2 + distanceFromSeparator + mountBlockDepth));
|
||||
|
||||
ventDz = railBottomThickness+distanceFromSeparator+r;
|
||||
ventZ = railSideHeight-(ventDz+distanceFromSeparator+r+railBaseThickness);
|
||||
|
||||
if (ventY1 > 2*r) {
|
||||
translate(v = [0, ventDy1+r, ventDz])
|
||||
minkowski() {
|
||||
cube(size = [inf, ventY1-2*r, ventZ]);
|
||||
sphere(r = r);
|
||||
}
|
||||
}
|
||||
|
||||
if (ventY2 > 2*r) {
|
||||
translate(v = [0, ventDy2+r, ventDz])
|
||||
minkowski() {
|
||||
cube(size = [inf, ventY2-2*r, ventZ]);
|
||||
sphere(r = r);
|
||||
}
|
||||
}
|
||||
|
||||
cylindricalFiletNegative(p0=[sideRailBaseWidth,0,0],p1=[sideRailBaseWidth,0,inf], n=[1,-1,0],r=r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user