diff --git a/rack-mount/enclosed-box/animate.scad b/rack-mount/enclosed-box/animate.scad new file mode 100644 index 0000000..ba96341 --- /dev/null +++ b/rack-mount/enclosed-box/animate.scad @@ -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); +} diff --git a/rack-mount/enclosed-box/entry.scad b/rack-mount/enclosed-box/entry.scad index c10749d..d5e7a0c 100644 --- a/rack-mount/enclosed-box/entry.scad +++ b/rack-mount/enclosed-box/entry.scad @@ -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(); \ No newline at end of file diff --git a/rack-mount/enclosed-box/sideRail.scad b/rack-mount/enclosed-box/sideRail.scad index 12206c6..10b3c17 100644 --- a/rack-mount/enclosed-box/sideRail.scad +++ b/rack-mount/enclosed-box/sideRail.scad @@ -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]); + } + } } } diff --git a/rack-mount/patch-panel/animate.scad b/rack-mount/patch-panel/animate.scad new file mode 100644 index 0000000..03a7341 --- /dev/null +++ b/rack-mount/patch-panel/animate.scad @@ -0,0 +1,28 @@ +include <../common.scad> +use <./entry.scad> + +$vpt = [110,-42,36]; +$vpr = [77,0,23]; +$vpd = 445; +$vpf = 22.50; + +animatePatchPanel(at=$t); + +module animatePatchPanel(at=$t) { + + plateThickness = 3; + keystoneSpacing = 19; + slots = max(1,ceil(at*8)); + + rotate(a=[90,0,0]) + mirror(v=[0,0,1]) + render() + patchPanelSystem(numSlots = slots, plateThickness=plateThickness, keystoneSpacing=keystoneSpacing); + + // keystone visualization + for (i = [0:slots-1]) { + translate(v=[keystoneSpacing*i + 12, 0,0,]) // hardcoded offset + %rj45Keystone(); + } + +} \ No newline at end of file diff --git a/rack-mount/patch-panel/entry.scad b/rack-mount/patch-panel/entry.scad index 8ac8b69..5750caa 100644 --- a/rack-mount/patch-panel/entry.scad +++ b/rack-mount/patch-panel/entry.scad @@ -1,18 +1,26 @@ use <./patchPanel.scad> /* - Parametric patch panel - + Parametric patch panel for rj45 keystones Please also make sure that the correct rack frame preset is set in rackFrame.scad. TODO add support for 2d arrays */ +module patchPanelSystem ( + // begin config //////////////////////////////////////////////////////////////////////////////////////////////////////// -numSlots = 8; +numSlots = 8, +plateThickness = 3, +keystoneSpacing = 19 // end config ////////////////////////////////////////////////////////////////////////////////////////////////////////// -mirror(v=[0,0,1]) -patchPanel(slots=numSlots); +) { + mirror(v = [0, 0, 1]) + patchPanel(slots = numSlots); +} + +patchPanelSystem(); \ No newline at end of file diff --git a/rack-mount/patch-panel/patchPanel.scad b/rack-mount/patch-panel/patchPanel.scad index 846b159..1ab7d85 100644 --- a/rack-mount/patch-panel/patchPanel.scad +++ b/rack-mount/patch-panel/patchPanel.scad @@ -7,12 +7,9 @@ use <../plateBase.scad> Please also make sure that the correct rack frame preset is set in rackFrame.scad. */ -*patchPanel(slots=2); -module patchPanel (slots=8) { +module patchPanel (slots=8, plateThickness=3, keystoneSpacing=19) { difference() { - plateThickness = 3; - keystoneSpacing = 19; supportPlateThickness = 5.9; supportPlateHeight = 29; supportPlateEdgeSpacing = 3; diff --git a/rack-mount/plateBase.scad b/rack-mount/plateBase.scad index 0d37454..6209349 100644 --- a/rack-mount/plateBase.scad +++ b/rack-mount/plateBase.scad @@ -20,7 +20,7 @@ module plateBase(U, plateThickness, screwType, screwToXEdge=4.5, screwToYEdge=4. mirror4XY(p=[screwToXEdge, screwToYEdge], dx=screwDx, dy=screwDy) translate(v=[0,0,plateThickness]) - cylinder(r=screwRadiusSlacked(screwType), h=plateThickness*2, center=true); + cylinder(r=screwRadiusSlacked(screwType), h=inf, center=true); } module base() { diff --git a/rack-mount/tray/animate.scad b/rack-mount/tray/animate.scad new file mode 100644 index 0000000..293d597 --- /dev/null +++ b/rack-mount/tray/animate.scad @@ -0,0 +1,20 @@ +include <../common.scad> +use <./entry.scad> + +$vpt = [100,-42,36]; +$vpr = [70,0,27]; +$vpd = 445; +$vpf = 22.50; + +animateTraySystem(at=$t); + +module animateTraySystem(at=$t) { + + trayU = max(1, ceil(at*3)); + x=100; + y=100; + dx = abs(lerp(a=-40, b=40, t=at)); + dy = abs(lerp(a=-30, b=30, t=at)); + + traySystem(trayU=trayU, baseWidth=x+dx, baseDepth=y+dy, mountPoints=[]); +} \ No newline at end of file diff --git a/rack-mount/tray/entry.scad b/rack-mount/tray/entry.scad index 556a5b3..969318c 100644 --- a/rack-mount/tray/entry.scad +++ b/rack-mount/tray/entry.scad @@ -8,25 +8,27 @@ use <./tray.scad> !!! Please also make sure that the correct rack frame preset is set in rackFrame.scad !!! */ +module traySystem ( + // begin config //////////////////////////////////////////////////////////////////////////////////////////////////////// -trayU = 2; +trayU = 2, -baseWidth = 145; -baseDepth = 100; +baseWidth = 145, +baseDepth = 100, -baseThickness = 3; // tray bottom thickness -frontThickness = 3; // front plate thickness -sideThickness = 3; +baseThickness = 3, // tray bottom thickness +frontThickness = 3, // front plate thickness +sideThickness = 3, -backLipHeight = 2; -frontLipHeight = 2; +backLipHeight = 2, +frontLipHeight = 2, -sideSupport = true; -trayLeftPadding = 10; // extra space between the left rail and tray. configure this to move the tray left/right. +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 +mountPointType = "m3", +mountPointElevation = 1, // basically standoff height // add/config standoff coordinates here. Format is [[x,y]] mountPoints = [ @@ -34,22 +36,27 @@ mountPoints = [ [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 -); \ No newline at end of file + 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 + ); +} + +traySystem(); \ No newline at end of file diff --git a/rack-mount/tray/tray.scad b/rack-mount/tray/tray.scad index 0e62a59..a7f7146 100644 --- a/rack-mount/tray/tray.scad +++ b/rack-mount/tray/tray.scad @@ -62,23 +62,28 @@ module bottomScrewTray(u, trayWidth, trayDepth, trayThickness, mountPoints, moun mountPointPosThickness = 2; - apply_pn() { - for (i = [0:len(mountPoints)-1]) { - x = mountPoints[i][0]; - y = mountPoints[i][1]; + if (len(mountPoints) > 0) { + 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); + 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); } + } else { children(0); }