Rewrite keystone.scad (#35)

* helper/keystone: rewrite completely

* rack-mount/patch-panel: edit to adapt to the new keystone

* helper/keystone: fill the lug-side opening

* rack-mount/patch-panel: allow combining two types of keystones and
plates freely

* rack-mount/patch-panel/entry: apply suggestions

Co-authored-by: Zhao (Jack) Wang <jazwang@proton.me>

* rack-mount/patch-panel: fix animate.scad & regen gif

---------

Co-authored-by: Zhao (Jack) Wang <jazwang@proton.me>
This commit is contained in:
Kiria
2025-03-21 10:34:54 +08:00
committed by GitHub
parent caa7073d2f
commit 6516c22dc3
7 changed files with 94 additions and 42 deletions

View File

@ -8,35 +8,34 @@ use <../plateBase.scad>
Please also make sure that the correct rack frame preset is set in rackFrame.scad.
*/
module patchPanel (slots=8, plateThickness=3, keystoneSpacing=19, center=false) {
module patchPanel(slots, plateThickness = 3, screwToXEdge = 4.5, screwToYEdge = 4.5, keystoneSpacing = 19, center = false) {
slotsWidth = len(slots) * keystoneSpacing;
slotsMinPadding = railScrewHoleToInnerEdge+4;
plateLength = rackMountScrewWidth + 2 * screwToXEdge;
plateHeight = 2 * uDiff + 2 * screwToXEdge;
leftRailScrewToSlots = center
? (plateLength-(slotsWidth+slotsMinPadding))/2
: slotsMinPadding;
difference() {
supportPlateThickness = 5.9;
supportPlateHeight = 29;
supportPlateEdgeSpacing = 3;
supportPlateWidth = slots * keystoneSpacing + supportPlateEdgeSpacing;
supportPlateMinPadding = railScrewHoleToInnerEdge+4;
plateBase(U = 2, plateThickness = plateThickness, screwType = mainRailScrewType, screwToXEdge = screwToXEdge, screwToYEdge = screwToYEdge, filletR = 2);
translate([leftRailScrewToSlots, -screwToYEdge - 10 * eps, -plateThickness - 10 * eps])
cube([slotsWidth, plateHeight + 2 * 10 * eps, plateThickness + 2 * 10 * eps]);
}
// TODO: these values should belong somewhere closer to plateBase.scad
railScrewToEdge = 4.5;
plateLength = rackMountScrewWidth + 2*railScrewToEdge;
leftRailScrewToSupportDx = center
? (plateLength-(supportPlateWidth+supportPlateMinPadding))/2
: supportPlateMinPadding;
union() {
plateBase(U = 2, plateThickness = plateThickness, screwType = mainRailScrewType, screwToXEdge=railScrewToEdge, screwToYEdge=railScrewToEdge, filletR = 2);
translate(v = [leftRailScrewToSupportDx, - railScrewToEdge, - supportPlateThickness])
cube(size = [supportPlateWidth, supportPlateHeight, supportPlateThickness]);
}
render()
union() {
for (i = [0:slots-1]) {
translate(v = [leftRailScrewToSupportDx+supportPlateEdgeSpacing + i*keystoneSpacing, 0, eps])
rotate(a = [-90, 0, 0])
rj45KeystoneJack_N();
}
}
for(i = [0 : len(slots) - 1]) {
translate([leftRailScrewToSlots + keystoneSpacing / 2 + i * keystoneSpacing, uDiff, -plateThickness])
let (slot = slots[i])
if (slot == 1) keystone1(outerWidth = keystoneSpacing, outerHeight = plateHeight);
else if (slot == 2) keystone2(outerWidth = keystoneSpacing, outerHeight = plateHeight);
else if (slot == 3) plate(outerWidth = keystoneSpacing, outerHeight = plateHeight, thickness = plateThickness);
else if (slot == 4) plate(outerWidth = keystoneSpacing, outerHeight = plateHeight, thickness = 5.9);
else if (slot == 5) plate(outerWidth = keystoneSpacing, outerHeight = plateHeight, thickness = 9.9);
else assert(false);
}
}
module plate(outerWidth, outerHeight, thickness) {
translate([0, 0, thickness / 2])
cube([outerWidth, outerHeight, thickness], center = true);
}