improve support side rail. also begin refactoring rack-mount to make more friendly
This commit is contained in:
53
rack-mount/enclosed-box/boxHelper.scad
Normal file
53
rack-mount/enclosed-box/boxHelper.scad
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
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
|
||||||
|
);
|
||||||
@ -1,3 +1,3 @@
|
|||||||
use <../sideRail.scad>
|
use <../sideRail.scad>
|
||||||
|
|
||||||
sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.2, supportedY=101.5, supportedX=159);
|
sideSupportRailBase(top=true, defaultThickness=1.4, supportedZ=27.2, supportedY=101.5, supportedX=159);
|
||||||
@ -1,4 +1,4 @@
|
|||||||
use <../sideRail.scad>
|
use <../sideRail.scad>
|
||||||
|
|
||||||
mirror(v=[1,0,0])
|
mirror(v=[1,0,0])
|
||||||
sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.2, supportedY=101.5, supportedX=159);
|
sideSupportRailBase(top=true, defaultThickness=1.4, supportedZ=27.2, supportedY=101.5, supportedX=159);
|
||||||
@ -1,7 +1,7 @@
|
|||||||
use <../tray.scad>
|
use <../tray.scad>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Parametric rack-mount tray -
|
Parametric rack-mount tray:
|
||||||
Dimensions can be adjusted using the variables below. You can also add mounting holes to fasten things that have
|
Dimensions can be adjusted using the variables below. You can also add mounting holes to fasten things that have
|
||||||
screw holes at the bottom.
|
screw holes at the bottom.
|
||||||
|
|
||||||
|
|||||||
@ -3,115 +3,144 @@ include <../config/common.scad>
|
|||||||
include <../rack/sharedVariables.scad>
|
include <../rack/sharedVariables.scad>
|
||||||
include <./common.scad>
|
include <./common.scad>
|
||||||
|
|
||||||
sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.2, supportedY=101.5, supportedX=159);
|
//sideSupportRailBase(top=true, defaultThickness=1.5, supportedZ=27.2, supportedY=101.5, supportedX=159);
|
||||||
|
|
||||||
// distance between front and back main rail screw mounts
|
// distance between front and back main rail screw mounts
|
||||||
sideRailScrewMountDist = yBarDepth - 2*(frontScrewSpacing + railFrontThickness + railSlotToXZ);
|
sideRailScrewMountDist = yBarDepth - 2*(frontScrewSpacing + railFrontThickness + railSlotToXZ);
|
||||||
|
|
||||||
module sideSupportRailBase(u=2, double=true, top=true, baseThickness=2, sideThickness=2, backThickness=2, supportedZ=27.5, supportedY=101.5, supportedX=159) {
|
module sideSupportRailBase(top=true, supportedZ, supportedY, supportedX, zOrientation="middle", defaultThickness=2) {
|
||||||
|
|
||||||
// TODO simplify this
|
|
||||||
mountBlockHeight = 10;
|
mountBlockHeight = 10;
|
||||||
mountBlockDepth = 10;
|
mountBlockDepth = 10;
|
||||||
screwMountGlobalDz = screwDiff / 2.0; // vertical distance between local origin and main rail screw mount
|
screwMountGlobalDz = screwDiff / 2.0; // vertical distance between local origin and main rail screw mount
|
||||||
sideRailScrewToMainRailFrontDx = frontScrewSpacing+railFrontThickness;
|
sideRailScrewToMainRailFrontDx = frontScrewSpacing+railFrontThickness;
|
||||||
railLength = max(sideRailScrewMountDist + sideRailScrewToMainRailFrontDx + mountBlockDepth/2, supportedY+backThickness);
|
railLength = max(sideRailScrewMountDist + sideRailScrewToMainRailFrontDx + mountBlockDepth/2, supportedY+defaultThickness);
|
||||||
railBaseThickness = baseThickness;
|
railBaseThickness = defaultThickness; // default thickness value
|
||||||
railSideThickness = sideThickness;
|
railSideThickness = 4;
|
||||||
|
railBackThickness = 3;
|
||||||
railBaseWidth = 15;
|
railBaseWidth = 15;
|
||||||
railSideHeight = supportedZ + railBaseThickness*2 + overhangSlack;
|
// 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;
|
||||||
|
|
||||||
|
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;
|
frontMountPad = (sideRailScrewToMainRailFrontDx-mountBlockDepth/2)-xySlack;
|
||||||
|
|
||||||
|
translate(v=[-railSideThickness, 0, -railBottomThickness])
|
||||||
applyMainRailMounts()
|
applyMainRailMounts()
|
||||||
sideSupportRailBase();
|
sideSupportRailBase();
|
||||||
|
|
||||||
echo(frontScrewSpacing);
|
|
||||||
echo(sideRailScrewToMainRailFrontDx);
|
|
||||||
|
|
||||||
module applyMainRailMounts() {
|
module applyMainRailMounts() {
|
||||||
mountBlockExtension = (railSupportsDx - supportedX)/2 - railSideThickness;
|
|
||||||
assert(mountBlockExtension >= 10);
|
|
||||||
|
|
||||||
apply_p() {
|
mountBlockExtension = (railSupportsDx - supportedX)/2 - railSideThickness;
|
||||||
union() {
|
minHexNutPocketToXYDist = mountBlockHeight/2;
|
||||||
translate(v = [0, frontMountPad, 0])
|
minHexNutPocketToXZDist = mountBlockDepth/2;
|
||||||
mountBlockColumn(mountBlockExtension=mountBlockExtension, u=u);
|
minHexNutPocketToYZDist = 4;
|
||||||
translate(v=[0,frontMountPad+sideRailScrewMountDist, 0])
|
screwU = floor((railSideHeight) / uDiff)-1;
|
||||||
mountBlockColumn(mountBlockExtension=mountBlockExtension, u=u);
|
|
||||||
}
|
apply_pn() {
|
||||||
|
mountBlockPositive();
|
||||||
|
mountBlockNegative();
|
||||||
children(0);
|
children(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module mountBlockPositive() {
|
||||||
|
translate(v = [0, frontMountPad, 0])
|
||||||
|
singleMountBlockPositive();
|
||||||
|
translate(v=[0,frontMountPad+sideRailScrewMountDist, 0])
|
||||||
|
singleMountBlockPositive();
|
||||||
}
|
}
|
||||||
|
|
||||||
module mountBlockColumn(mountBlockExtension, u) {
|
module mountBlockNegative() {
|
||||||
|
translate(v = [0, frontMountPad, 0])
|
||||||
|
singleMountBlockNegative();
|
||||||
|
translate(v=[0,frontMountPad+sideRailScrewMountDist, 0])
|
||||||
|
singleMountBlockNegative();
|
||||||
|
}
|
||||||
|
|
||||||
difference() {
|
module singleMountBlockPositive() {
|
||||||
translate(v = [-mountBlockExtension, 0, 0])
|
translate(v = [-mountBlockExtension, 0, 0])
|
||||||
cube(size = [mountBlockExtension, mountBlockDepth, railSideHeight]);
|
cube(size = [mountBlockExtension, mountBlockDepth, railSideHeight]);
|
||||||
|
}
|
||||||
|
|
||||||
union() {
|
module singleMountBlockNegative() {
|
||||||
nutPocket();
|
nutPocket();
|
||||||
|
|
||||||
if (double) {
|
translate(v = [0, 0, uDiff*screwU])
|
||||||
translate(v=[0,0,uDiff * u]) // screwMountToGlobalZ
|
|
||||||
nutPocket();
|
nutPocket();
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module nutPocket() {
|
module nutPocket() {
|
||||||
translate(v=[-mountBlockExtension/2,mountBlockDepth/2,mountBlockHeight/2]) // screwMountToGlobalZ
|
translate(v=[-mountBlockExtension+minHexNutPocketToYZDist, minHexNutPocketToXZDist, minHexNutPocketToXYDist])
|
||||||
rotate(a=[90,0,0])
|
rotate(a=[-90,0,90])
|
||||||
rotate(a=[0,90,0])
|
hexNutPocket_N(rackFrameScrewType, openSide=false, backSpace=min((railSideThickness-1)+mountBlockExtension-minHexNutPocketToYZDist,15));
|
||||||
hexNutPocket_N(rackFrameScrewType, openSide=false);
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
module sideSupportRailBase() {
|
module sideSupportRailBase() {
|
||||||
backThickness = 3;
|
|
||||||
|
|
||||||
difference () {
|
difference () {
|
||||||
union() {
|
union() {
|
||||||
cube(size = [railBaseWidth, railLength, railBaseThickness]);
|
cube(size = [railBaseWidth, railLength, railBottomThickness]);
|
||||||
|
|
||||||
cube(size = [railSideThickness, railLength, railSideHeight]);
|
cube(size = [railSideThickness, railLength, railSideHeight]);
|
||||||
|
|
||||||
// back support
|
// back support
|
||||||
translate(v = [0, max(railLength-backThickness, supportedY), 0])
|
translate(v = [0, max(railLength-railBackThickness, supportedY), 0])
|
||||||
cube(size = [railBaseWidth, backThickness, railSideHeight]);
|
cube(size = [railBaseWidth, railBackThickness, railSideHeight]);
|
||||||
|
|
||||||
// back support for box
|
// back support for box
|
||||||
translate(v = [0, supportedY, 0])
|
translate(v = [0, supportedY, 0])
|
||||||
cube(size = [railBaseWidth, backThickness, railSideHeight]);
|
cube(size = [railBaseWidth, railBackThickness, railSideHeight]);
|
||||||
|
|
||||||
// top support
|
// top support
|
||||||
if (top) {
|
if (top) {
|
||||||
translate(v = [0, 0, railSideHeight-baseThickness])
|
translate(v = [0, 0, railSideHeight-railBaseThickness])
|
||||||
cube(size = [railBaseWidth, railLength, railBaseThickness]);
|
cube(size = [railBaseWidth, railLength, railBaseThickness]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
union() {
|
union() {
|
||||||
distanceFromSeparator = 3;
|
distanceFromSeparator = 3;
|
||||||
r = 5;
|
r = 4;
|
||||||
|
|
||||||
boxDy = frontMountPad+r+mountBlockDepth+distanceFromSeparator;
|
ventDy1 = frontMountPad+mountBlockDepth+distanceFromSeparator;
|
||||||
boxDz = baseThickness+distanceFromSeparator+r;
|
ventY1 = min(supportedY-(ventDy1+distanceFromSeparator), sideRailScrewMountDist-(2*distanceFromSeparator+mountBlockDepth));
|
||||||
translate(v=[0,boxDy,boxDz])
|
|
||||||
|
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() {
|
minkowski() {
|
||||||
cube(size = [sideThickness, supportedY-(boxDy+distanceFromSeparator+r), railSideHeight-2*boxDz]);
|
cube(size = [inf, ventY1-2*r, ventZ]);
|
||||||
sphere(r=r);
|
sphere(r = r);
|
||||||
}
|
}
|
||||||
translate(v=[0,supportedY+distanceFromSeparator+r+backThickness,boxDz])
|
|
||||||
minkowski() {
|
|
||||||
cube(size = [sideThickness, 25, railSideHeight-2*boxDz]);
|
|
||||||
sphere(r=r);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cylindricalFiletNegative(p0=[railBaseWidth,0,0],p1=[railBaseWidth,0,inf], n=[1,-1,0],r=4);
|
if (ventY2 > 2*r) {
|
||||||
|
translate(v = [0, ventDy2+r, ventDz])
|
||||||
|
minkowski() {
|
||||||
|
cube(size = [inf, ventY2-2*r, ventZ]);
|
||||||
|
sphere(r = r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cylindricalFiletNegative(p0=[railBaseWidth,0,0],p1=[railBaseWidth,0,inf], n=[1,-1,0],r=r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user