diff --git a/TODO.md b/TODO.md index 542b27f..c0d25e5 100644 --- a/TODO.md +++ b/TODO.md @@ -7,6 +7,7 @@ - Start working on actual cases - Figure out why sidewall build is so slow - Tidy up imports +- Standardize meaning of `U` ### Ideas - Clean up `sharedVariables.scad`!!! diff --git a/helper/keystone.scad b/helper/keystone.scad index f860adc..3d69cfe 100644 --- a/helper/keystone.scad +++ b/helper/keystone.scad @@ -1,4 +1,6 @@ +include <../config/slack.scad> + // rj45 slot-to-slot keystone jack model and negative keystoneMainBodyWidth = 15.0; keystoneMainBodyHeight = 16.90; @@ -17,28 +19,29 @@ frontToSideLugFront = 10.63; module rj45Keystone() { // main keystone body (no hooks or lugs) - cube(size=[keystoneMainBodyWidth, keystoneMainBodyDepth, keystoneMainBodyHeight]); + cube(size=[keystoneMainBodyWidth + xySlack, keystoneMainBodyDepth + xySlack, keystoneMainBodyHeight]); // slot for top hook translate(v=[0,frontToHookCatch,0]) - cube(size=[keystoneMainBodyWidth, keystoneMainBodyDepth -frontToHookCatch, heightWithHookBody]); - cube(size=[keystoneMainBodyWidth, frontToHookCatch, heightWithHookCatch]); + cube(size=[keystoneMainBodyWidth + xySlack, keystoneMainBodyDepth-frontToHookCatch + xySlack, heightWithHookBody]); + + cube(size=[keystoneMainBodyWidth + xySlack, frontToHookCatch + xySlack, heightWithHookCatch]); // slots for side lugs translate(v=[-sideLugWidth, frontToSideLugFront,0]) - cube(size=[widthWithSideLugs, keystoneMainBodyDepth-frontToSideLugFront, keystoneMainBodyHeight]); + cube(size=[widthWithSideLugs + xySlack, keystoneMainBodyDepth-frontToSideLugFront + xySlack, keystoneMainBodyHeight]); // slots for bottom lugs translate(v=[0,0,-(heightWithBottomLug-keystoneMainBodyHeight)]) - cube(size=[keystoneMainBodyWidth, frontToBottomLugBack, keystoneMainBodyHeight]); + cube(size=[keystoneMainBodyWidth + xySlack, frontToBottomLugBack + xySlack, keystoneMainBodyHeight]); } module rj45KeystoneJack_N() { translate(v=[0,-4,0.5]) // why? - intersection() { - translate(v=[-2.5,4,-4]) - cube(size=[20,6,28]); - rj45Keystone(); - } + intersection() { + translate(v=[-2.5,4,-4]) + cube(size=[20,6,28]); + rj45Keystone(); + } } diff --git a/helper/math.scad b/helper/math.scad index 62235ec..5f9a880 100644 --- a/helper/math.scad +++ b/helper/math.scad @@ -1,7 +1,7 @@ // Some misc math-y utils $fn=64; -eps=0.0001; +eps=0.001; inf10 = 10; inf50 = 50; inf1000 = 1000; diff --git a/rack-mount/frontBoxHolder.scad b/rack-mount/frontBoxHolder.scad new file mode 100644 index 0000000..0a40f65 --- /dev/null +++ b/rack-mount/frontBoxHolder.scad @@ -0,0 +1,10 @@ +// To be used with closed sideRails to fully encapsulate a box + +include <../config/common.scad> +include <../helper/common.scad> +use <./plateBase.scad> + +module frontBoxHolder(plateThickness=3, plate) { + + +} diff --git a/rack-mount/patchPanel.scad b/rack-mount/patchPanel.scad index e69de29..f52fd00 100644 --- a/rack-mount/patchPanel.scad +++ b/rack-mount/patchPanel.scad @@ -0,0 +1,35 @@ +include <../config/common.scad> +include <../helper/common.scad> +include <../rack/sharedVariables.scad> +use <./plateBase.scad> + + +patchPanel(slots=2); + +module patchPanel (slots=8) { + difference() { + plateThickness = 3; + keystoneSpacing = 19; + supportPlateThickness = 5.9; + supportPlateHeight = 29; + supportPlateEdgeSpacing = 3; + supportPlateWidth = slots * keystoneSpacing + supportPlateEdgeSpacing; + + leftRailScrewToSupportDx = railScrewHoleToInnerEdge+4; + railScrewToEdge = 4.5; + + union() { + plateBase(U = 2, plateThickness = plateThickness, screwType = mainRailScrewType, screwToXEdge=railScrewToEdge, screwToYEdge=railScrewToEdge, filletR = 2); + translate(v = [leftRailScrewToSupportDx, - railScrewToEdge, - supportPlateThickness]) + cube(size = [supportPlateWidth, supportPlateHeight, supportPlateThickness]); + } + + union() { + for (i = [0:slots-1]) { + translate(v = [leftRailScrewToSupportDx+supportPlateEdgeSpacing + i*keystoneSpacing, 0, eps]) + rotate(a = [-90, 0, 0]) + rj45KeystoneJack_N(); + } + } + } +} \ No newline at end of file diff --git a/rack-mount/plateBase.scad b/rack-mount/plateBase.scad index a4254a5..b4a2591 100644 --- a/rack-mount/plateBase.scad +++ b/rack-mount/plateBase.scad @@ -3,7 +3,7 @@ include <./common.scad> plateBase(U=2, plateThickness=3, screwType="m4", filletR=2); -module plateBase(U, plateThickness, screwType, screwToXEdge=4, screwToYEdge=4, filletR=2) { +module plateBase(U, plateThickness, screwType, screwToXEdge=4.5, screwToYEdge=4.5, filletR=2) { assert(floor(U) == U && U > 0) assert(plateThickness > 0); @@ -14,11 +14,12 @@ module plateBase(U, plateThickness, screwType, screwToXEdge=4, screwToYEdge=4, f plateLength = screwDx + 2*screwToXEdge; plateHeight = screwDy + 2*screwToYEdge; - translate(v=[0,0,-plateThickness]) // easier to work with + translate(v=[-screwToXEdge,-screwToYEdge,-plateThickness]) // easier to work with difference() { base(); mirror4XY(p=[screwToXEdge, screwToYEdge], dx=screwDx, dy=screwDy) + translate(v=[0,0,plateThickness]) cylinder(r=screwRadiusSlacked(screwType), h=plateThickness*2, center=true); } @@ -26,7 +27,6 @@ module plateBase(U, plateThickness, screwType, screwToXEdge=4, screwToYEdge=4, f minkowski() { translate(v=[filletR, filletR, 0]) cube(size = [plateLength-2*filletR, plateHeight-2*filletR, plateThickness]); - cylinder(r=filletR, h=eps); } } diff --git a/rack-mount/print/patchPanel_P.scad b/rack-mount/print/patchPanel_P.scad new file mode 100644 index 0000000..c62e048 --- /dev/null +++ b/rack-mount/print/patchPanel_P.scad @@ -0,0 +1,3 @@ +use <../patchPanel.scad> + +patchPanel(slots=8); diff --git a/rack-mount/sideRail.scad b/rack-mount/sideRail.scad index 3fd9740..aceddca 100644 --- a/rack-mount/sideRail.scad +++ b/rack-mount/sideRail.scad @@ -8,7 +8,7 @@ sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness // distance between front and back main rail screw mounts sideRailScrewMountDist = yBarDepth - 2*(frontScrewSpacing + railFrontThickness + railSlotToXZ); -module sideSupportRailBase(u=2, double=true, top=true, baseThickness=2, sideThickness=2, backThickness=2, supportedZ=26.5, supportedY=101.5, supportedX=159) { +module sideSupportRailBase(u=2, double=true, top=true, baseThickness=2, sideThickness=2, backThickness=2, supportedZ=27.5, supportedY=101.5, supportedX=159) { mountBlockHeight = 10; mountBlockDepth = 10; diff --git a/rbuild.py b/rbuild.py index eb2ea63..6a49e9f 100644 --- a/rbuild.py +++ b/rbuild.py @@ -3,8 +3,9 @@ import argparse import subprocess import os -import sys +PATH_TO_OPENSCAD = '/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD' +PATH_TO_OPENSCAD_NIGHTLY = 'path/to/nightly/build' # For actual dimensions, please see profiles.scad. class BuildSizeConfig: @@ -23,9 +24,9 @@ RACK_MOUNT_BUILD_TARGET_SUB_DIR = 'rack-mount' def main(): - if not assert_os(): - print("Linux Required for OpenSCAD CLI") - return + + if not assertOpenscadExists(): + print("Could not find OpenSCAD binary. Please make sure it's configured in rbuild.py. Currently only Darwin and Linux have been tested to work.") parser = argparse.ArgumentParser( prog='rbuild', @@ -75,6 +76,10 @@ def main(): def run_build(args): build_var = args.b + + if build_var is None: + print("Please provide the build (-b) variable") # TODO redundant + config_var = args.c target_var = args.t dz = args.dz @@ -166,9 +171,9 @@ def find_scad_file(directory, filename): def run_openscad(options, nightly): if nightly: - command = ['openscad-nightly', '--enable', 'all'] + command = [PATH_TO_OPENSCAD_NIGHTLY, '--enable', 'all'] else: - command = ['openscad'] + command = [PATH_TO_OPENSCAD] command += ['--export-format', 'binstl'] + options try: @@ -178,14 +183,8 @@ def run_openscad(options, nightly): print('OpenSCAD command not found! ' 'Please make sure that you have OpenSCAD installed and can run OpenSCAD CLI commands. ' '(Currently needs Linux for this)') - - -def assert_os(): - if sys.platform == 'linux': - return True - else: - return False - +def assertOpenscadExists(): + return os.path.exists(PATH_TO_OPENSCAD) if __name__ == '__main__': main() diff --git a/stl/micro/rack-mount/patchPanel_P.stl b/stl/micro/rack-mount/patchPanel_P.stl new file mode 100644 index 0000000..f36b738 Binary files /dev/null and b/stl/micro/rack-mount/patchPanel_P.stl differ diff --git a/stl/micro/rack-mount/sideSupportRail_P1.stl b/stl/micro/rack-mount/sideSupportRail_P1.stl index c48ef16..a2dd054 100644 Binary files a/stl/micro/rack-mount/sideSupportRail_P1.stl and b/stl/micro/rack-mount/sideSupportRail_P1.stl differ diff --git a/stl/micro/rack-mount/sideSupportRail_P2.stl b/stl/micro/rack-mount/sideSupportRail_P2.stl index 185fe52..3533ebb 100644 Binary files a/stl/micro/rack-mount/sideSupportRail_P2.stl and b/stl/micro/rack-mount/sideSupportRail_P2.stl differ diff --git a/stl/micro/rack-mount/tray_P.stl b/stl/micro/rack-mount/tray_P.stl index ecc00c1..26a90f5 100644 Binary files a/stl/micro/rack-mount/tray_P.stl and b/stl/micro/rack-mount/tray_P.stl differ diff --git a/stl/micro/rack/eval_P.stl b/stl/micro/rack/eval_P.stl index 8cc2c6f..8faa7ee 100644 Binary files a/stl/micro/rack/eval_P.stl and b/stl/micro/rack/eval_P.stl differ diff --git a/stl/micro/rack/hingeModule_P1.stl b/stl/micro/rack/hingeModule_P1.stl index 2d9f739..dd8befe 100644 Binary files a/stl/micro/rack/hingeModule_P1.stl and b/stl/micro/rack/hingeModule_P1.stl differ diff --git a/stl/micro/rack/magnetModule_P1.stl b/stl/micro/rack/magnetModule_P1.stl index b3fe8c8..6ef4b64 100644 Binary files a/stl/micro/rack/magnetModule_P1.stl and b/stl/micro/rack/magnetModule_P1.stl differ diff --git a/stl/micro/rack/magnetModule_P2.stl b/stl/micro/rack/magnetModule_P2.stl index b1ef18d..5d23b03 100644 Binary files a/stl/micro/rack/magnetModule_P2.stl and b/stl/micro/rack/magnetModule_P2.stl differ diff --git a/stl/micro/rack/mainRail_P.stl b/stl/micro/rack/mainRail_P.stl index ede2c44..264bf5a 100644 Binary files a/stl/micro/rack/mainRail_P.stl and b/stl/micro/rack/mainRail_P.stl differ diff --git a/stl/micro/rack/sideWallLeft_P.stl b/stl/micro/rack/sideWallLeft_P.stl index 756d487..0cd18d6 100644 Binary files a/stl/micro/rack/sideWallLeft_P.stl and b/stl/micro/rack/sideWallLeft_P.stl differ diff --git a/stl/micro/rack/sideWallRight_P.stl b/stl/micro/rack/sideWallRight_P.stl index 39d46d7..5f94eb9 100644 Binary files a/stl/micro/rack/sideWallRight_P.stl and b/stl/micro/rack/sideWallRight_P.stl differ diff --git a/stl/micro/rack/stackConnectorBottom_P.stl b/stl/micro/rack/stackConnectorBottom_P.stl index d0c55d4..6a029f8 100644 Binary files a/stl/micro/rack/stackConnectorBottom_P.stl and b/stl/micro/rack/stackConnectorBottom_P.stl differ diff --git a/stl/micro/rack/stackConnectorDual_P.stl b/stl/micro/rack/stackConnectorDual_P.stl index 402b6af..b1ebeb6 100644 Binary files a/stl/micro/rack/stackConnectorDual_P.stl and b/stl/micro/rack/stackConnectorDual_P.stl differ diff --git a/stl/micro/rack/xBar_P.stl b/stl/micro/rack/xBar_P.stl index 43b5035..2828f6a 100644 Binary files a/stl/micro/rack/xBar_P.stl and b/stl/micro/rack/xBar_P.stl differ diff --git a/stl/micro/rack/xyPlate_P.stl b/stl/micro/rack/xyPlate_P.stl index 3ea9f0c..2c97337 100644 Binary files a/stl/micro/rack/xyPlate_P.stl and b/stl/micro/rack/xyPlate_P.stl differ diff --git a/stl/micro/rack/yBar_P.stl b/stl/micro/rack/yBar_P.stl index b18521b..a5231d3 100644 Binary files a/stl/micro/rack/yBar_P.stl and b/stl/micro/rack/yBar_P.stl differ