diff --git a/README.md b/README.md index 813e1b6..e47c656 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ - ***Mount Anything:*** Perfect for organizing SBCs, mini PCs, small switches, power hubs, etc. - ***Fully customizable:*** Fully written in OpenSCAD. Everything, from the dimensions of the rack, to the roundness of the corners, can be modified with a simple code change. - ***Printable from home:*** Designed to be printed with conventional FDM printers. Requires minimal supports when printing, and final assembly needs only a few easy-to-source parts. -- ***No cage nuts!*** Sliding hex nut design for the front rails allows one to easily mount items without dealing with cage nuts. +- ***No cage nuts!*** Sliding hex nut design for the front rails allows one to easily mount items, without dealing with cage nuts. - ***Stackable:*** Individual racks can be easily stacked and fastened together. Mix and match different color and design combinations! ## Assembly @@ -51,9 +51,9 @@ Please see [the assembly README here](./assembly-guide) | [Feet](./rack/print/feet_P.scad) (optional) | 2 | - #### Notes: - +- Before printing the actual parts. It's recommended to print this evaluation part: [eval_P](./rack/print/eval_P.scad) to test tolerances. If you find the fits too tight/loose, you can adjust them [here](./config/slack.scad). +- Please also adjust [this file](./config/slicer.scad) to match your slicer settings. - Omitted actual plastic for printing. Any conventional 3d printing plastic should do (PLA, PETG, ABS), but beware of PLA's thermal limits. Higher infill is recommended for all parts. - For joining two racks, you will need to print 4 [stackConnectorDuals](./rack/print/stackConnectorDual_P.scad), as well as 8 M3 hex nuts, and 8 M3x12 FHCS. @@ -73,18 +73,10 @@ Generate all project files for the `micro` profile: `python3 rbuild.py -b all -c micro` -This will build all the required STLs for a micro rack in the `stl/custom/` directory. +This will build all the parts defined in [rack/print](./rack/print), and put the STLs in [stl/micro](./stl/micro). For generating a specific part: `python3 rbuild.py -b yBar -c micro -t custom` -Generated stls are put into the `stl/` directories. The actual variable values for different profiles can be found in -[rack/profiles.scad](config/rackFrame.scad). - -`rbuild.py` also support an optional `--nightly` flag, which means the build script will use the `openscad-nightly` command, instead of `openscad`. - -We recommend you start by printing the `eval_P.stl` file first, just to determine if the default slack/layer height -configurations work for you. If parts are too tight/loose please take a look at -[config/slack.scad](config/slack.scad). Please also adjust [config/printing.scad](config/slicer.scad) to match your -slicer settings. \ No newline at end of file +`rbuild.py` also support an optional `--nightly` flag, which means the build script will use the `openscad-nightly` command, instead of `openscad`. \ No newline at end of file diff --git a/assembly-guide/gifs/attachSideConnectorModulesToYBars.gif b/assembly-guide/gifs/attachSideConnectorModulesToYBars.gif index b1ee590..4d245df 100644 Binary files a/assembly-guide/gifs/attachSideConnectorModulesToYBars.gif and b/assembly-guide/gifs/attachSideConnectorModulesToYBars.gif differ diff --git a/assembly-guide/gifs/attachXYPlates.gif b/assembly-guide/gifs/attachXYPlates.gif index 08db9f3..a72dc67 100644 Binary files a/assembly-guide/gifs/attachXYPlates.gif and b/assembly-guide/gifs/attachXYPlates.gif differ diff --git a/assembly-guide/gifs/attachXYTrays.gif b/assembly-guide/gifs/attachXYTrays.gif index a305058..1675175 100644 Binary files a/assembly-guide/gifs/attachXYTrays.gif and b/assembly-guide/gifs/attachXYTrays.gif differ diff --git a/assembly-guide/gifs/connectXYTrayWithMainRails.gif b/assembly-guide/gifs/connectXYTrayWithMainRails.gif index 4770148..9be4550 100644 Binary files a/assembly-guide/gifs/connectXYTrayWithMainRails.gif and b/assembly-guide/gifs/connectXYTrayWithMainRails.gif differ diff --git a/assembly-guide/gifs/insertFeet.gif b/assembly-guide/gifs/insertFeet.gif index 328c26f..87cc58c 100644 Binary files a/assembly-guide/gifs/insertFeet.gif and b/assembly-guide/gifs/insertFeet.gif differ diff --git a/assembly-guide/gifs/propUpBottomXYTraywithSideWalls.gif b/assembly-guide/gifs/propUpBottomXYTraywithSideWalls.gif index caed860..d36f8f0 100644 Binary files a/assembly-guide/gifs/propUpBottomXYTraywithSideWalls.gif and b/assembly-guide/gifs/propUpBottomXYTraywithSideWalls.gif differ diff --git a/assembly-guide/gifs/screwFeet.gif b/assembly-guide/gifs/screwFeet.gif index eb980cb..41491ee 100644 Binary files a/assembly-guide/gifs/screwFeet.gif and b/assembly-guide/gifs/screwFeet.gif differ diff --git a/assembly-guide/gifs/slideHexNutsIntoYBarXYPlate.gif b/assembly-guide/gifs/slideHexNutsIntoYBarXYPlate.gif index e75975c..03a5e0e 100644 Binary files a/assembly-guide/gifs/slideHexNutsIntoYBarXYPlate.gif and b/assembly-guide/gifs/slideHexNutsIntoYBarXYPlate.gif differ diff --git a/rack-mount/print/boxHolderHelper_P.scad b/rack-mount/print/boxHolderHelper_P.scad deleted file mode 100644 index 56e73dd..0000000 --- a/rack-mount/print/boxHolderHelper_P.scad +++ /dev/null @@ -1,8 +0,0 @@ -include <../../rack/sharedVariables.scad> -use <../frontBoxHolder.scad> -use <../sideRail.scad> - - -module boxHolderHelper() { - -} \ No newline at end of file diff --git a/rack-mount/print/frontBoxHolder_P.scad b/rack-mount/print/frontBoxHolder_P.scad index 2bfeddc..33f2032 100644 --- a/rack-mount/print/frontBoxHolder_P.scad +++ b/rack-mount/print/frontBoxHolder_P.scad @@ -5,12 +5,12 @@ frontBoxHolder( u=2, plateThickness=3, cutoutOffsetX=(rackMountScrewWidth-147)/2, - cutoutOffsetY=2, + cutoutOffsetY=4.25, cutoutX=147, - cutoutY=26, + cutoutY=21.5, support=true, - supportedZ = 27.5, + supportedZ = 26.5, supportWidth=120, supportDepth=5, - supportRailBaseThickness=1.25 + supportRailBaseThickness=1.75 ); diff --git a/rack-mount/print/sideSupportRail_P1.scad b/rack-mount/print/sideSupportRail_P1.scad index 278d840..65c8aac 100644 --- a/rack-mount/print/sideSupportRail_P1.scad +++ b/rack-mount/print/sideSupportRail_P1.scad @@ -1,3 +1,3 @@ use <../sideRail.scad> -sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.5, supportedY=101.5, supportedX=159); \ No newline at end of file +sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.2, supportedY=101.5, supportedX=159); \ No newline at end of file diff --git a/rack-mount/print/sideSupportRail_P2.scad b/rack-mount/print/sideSupportRail_P2.scad index b6df894..366ab2d 100644 --- a/rack-mount/print/sideSupportRail_P2.scad +++ b/rack-mount/print/sideSupportRail_P2.scad @@ -1,4 +1,4 @@ use <../sideRail.scad> mirror(v=[1,0,0]) -sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.5, supportedY=101.5, supportedX=159); \ No newline at end of file +sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.2, supportedY=101.5, supportedX=159); \ No newline at end of file diff --git a/rack-mount/sideRail.scad b/rack-mount/sideRail.scad index aceddca..2a50236 100644 --- a/rack-mount/sideRail.scad +++ b/rack-mount/sideRail.scad @@ -3,7 +3,7 @@ include <../config/common.scad> include <../rack/sharedVariables.scad> include <./common.scad> -sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.5, supportedY=101.5, supportedX=159); +sideSupportRailBase(u=2, double=true, top=true, baseThickness=1.5, sideThickness=4, backThickness=2, supportedZ=27.2, supportedY=101.5, supportedX=159); // distance between front and back main rail screw mounts sideRailScrewMountDist = yBarDepth - 2*(frontScrewSpacing + railFrontThickness + railSlotToXZ); @@ -13,18 +13,22 @@ module sideSupportRailBase(u=2, double=true, top=true, baseThickness=2, sideThic mountBlockHeight = 10; mountBlockDepth = 10; screwMountGlobalDz = screwDiff / 2.0; // vertical distance between local origin and main rail screw mount - railLength = max(sideRailScrewMountDist + frontScrewSpacing + mountBlockDepth, supportedY+backThickness); + sideRailScrewToMainRailFrontDx = frontScrewSpacing+railFrontThickness; + railLength = max(sideRailScrewMountDist + sideRailScrewToMainRailFrontDx + mountBlockDepth/2, supportedY+backThickness); railBaseThickness = baseThickness; railSideThickness = sideThickness; railBaseWidth = 15; - railSideHeight = supportedZ + railBaseThickness*2; - frontMountPad = frontScrewSpacing; + railSideHeight = supportedZ + railBaseThickness*2 + overhangSlack; + + frontMountPad = (sideRailScrewToMainRailFrontDx-mountBlockDepth/2)-xySlack; applyMainRailMounts() sideSupportRailBase(); - module applyMainRailMounts() { + echo(frontScrewSpacing); + echo(sideRailScrewToMainRailFrontDx); + module applyMainRailMounts() { mountBlockExtension = (railSupportsDx - supportedX)/2 - railSideThickness; assert(mountBlockExtension >= 10); diff --git a/rbuild.py b/rbuild.py index f7e92a1..106d1f5 100644 --- a/rbuild.py +++ b/rbuild.py @@ -7,24 +7,27 @@ import os PATH_TO_OPENSCAD = '/usr/bin/openscad' PATH_TO_OPENSCAD_NIGHTLY = '/snap/bin/openscad-nightly' + # For actual dimensions, please see profiles.scad. class BuildSizeConfig: NANO = 'nano' MINI = 'mini' MICRO = 'micro' -RACK_BUILD_DIR = './rack/print' -RACK_MOUNT_BUILD_DIR = './rack-mount/print' -BUILD_PARENT_DIR = './stl' +FILE_DIR = os.path.dirname(os.path.abspath(__file__)) + +RACK_BUILD_DIR = os.path.join(FILE_DIR, 'rack/print') +RACK_MOUNT_BUILD_DIR = os.path.join(FILE_DIR, 'rack-mount/print') +BUILD_PARENT_DIR = os.path.join(FILE_DIR, 'stl') RACK_BUILD_TARGET_SUB_DIR = 'rack' RACK_MOUNT_BUILD_TARGET_SUB_DIR = 'rack-mount' -ASSEMBLY_GIF_DIR = './rack/assembly' -ASSEMBLY_GIF_BUILD_DIR = './assembly-guide/gifs' -ASSEMBLY_GIF_TEMP_DIR = ASSEMBLY_GIF_BUILD_DIR + '/tmp' -BUILD_GIF_FROM_PNG_SCRIPT = './misc/animate.sh' +ASSEMBLY_GIF_DIR = os.path.join(FILE_DIR, 'rack/assembly') +ASSEMBLY_GIF_BUILD_DIR = os.path.join(FILE_DIR, 'assembly-guide/gifs') +ASSEMBLY_GIF_TEMP_DIR = os.path.join(ASSEMBLY_GIF_BUILD_DIR, 'tmp') +BUILD_GIF_FROM_PNG_SCRIPT = os.path.join(FILE_DIR, 'misc/animate.sh') ASSEMBLY_STEPS = [ ('slideHexNutsIntoYBar.scad', 24), @@ -44,10 +47,11 @@ ASSEMBLY_STEPS = [ ('attachXYPlates.scad', 16) ] -def main(): +def main(): 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.") + 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', @@ -101,7 +105,6 @@ def main(): def run_build(args): - build_var = args.b config_var = args.c target_var = args.t @@ -111,11 +114,11 @@ def run_build(args): if (build_var is not None) == (build_gifs is True): print("Please either provide the build (-b) variable, or the build-gifs option (--build-assembly-gifs)") - quit() + return if build_gifs: build_assembly_gifs(config_var, dz, nightly) - quit() + return if target_var != "": final_target_directory_name = target_var @@ -123,7 +126,8 @@ def run_build(args): final_target_directory_name = config_var rackBuildDirFull = os.path.join(BUILD_PARENT_DIR, final_target_directory_name, RACK_BUILD_TARGET_SUB_DIR) - rackMountBuildDirFull = os.path.join(BUILD_PARENT_DIR, final_target_directory_name, RACK_MOUNT_BUILD_TARGET_SUB_DIR) + rackMountBuildDirFull = os.path.join(BUILD_PARENT_DIR, final_target_directory_name, + RACK_MOUNT_BUILD_TARGET_SUB_DIR) if not os.path.exists(rackBuildDirFull): os.makedirs(rackBuildDirFull) @@ -136,7 +140,8 @@ def run_build(args): build_single(RACK_BUILD_DIR, rackBuildDirFull, dir_file, config_var, dz, nightly) for dir_file in os.listdir(RACK_MOUNT_BUILD_DIR): - build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, dir_file, config_var, dz, nightly) + build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, dir_file, config_var, dz, + nightly) return filename_rack = find_rack(build_var) @@ -152,11 +157,13 @@ def run_build(args): if filename_rack_mount: build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, filename_rack, config_var, dz, nightly) + def build_single(build_dir, target_dir, filename, config, dz, nightly): print('Building:', filename, 'from', build_dir, 'to', target_dir) openscad_args = construct_openscad_args(build_dir, target_dir, filename, config, dz) run_openscad(openscad_args, nightly) + def build_assembly_gifs(config, dz, nightly): print('Building assembly-gifs. Source Dir:', ASSEMBLY_GIF_DIR, '| Target:', ASSEMBLY_GIF_BUILD_DIR) @@ -168,11 +175,10 @@ def build_assembly_gifs(config, dz, nightly): run_openscad(openscad_args, nightly) build_gif_from_png(fileName) + def build_gif_from_png(fileName): - script_dir = os.path.dirname(os.path.abspath(__file__)) - script_path = os.path.join(script_dir, BUILD_GIF_FROM_PNG_SCRIPT) try: - subprocess.run(["bash", script_path, fileName], check=True) + subprocess.run(["bash", BUILD_GIF_FROM_PNG_SCRIPT, fileName], check=True) except subprocess.CalledProcessError as e: print(f"Error calling shell script: {e}") @@ -209,7 +215,6 @@ def construct_openscad_animation_args(build_dir, target_dir, filename, config, d return openscad_args - def find_rack(filename): return find_scad_file(RACK_BUILD_DIR, filename) @@ -236,7 +241,6 @@ def find_scad_file(directory, filename): def run_openscad(options, nightly): - if nightly: command = [PATH_TO_OPENSCAD_NIGHTLY, '--enable', 'all'] else: @@ -250,8 +254,11 @@ def run_openscad(options, nightly): print('OpenSCAD command not found! ' 'Please make sure that you have the OpenSCAD binary configured in rbuild.py.' '(Currently needs Linux/Mac for this)') + + def assertOpenscadExists(): return os.path.exists(PATH_TO_OPENSCAD) + if __name__ == '__main__': main() diff --git a/stl/micro/rack-mount/frontBoxHolder_P.stl b/stl/micro/rack-mount/frontBoxHolder_P.stl new file mode 100644 index 0000000..7fe837a Binary files /dev/null and b/stl/micro/rack-mount/frontBoxHolder_P.stl differ diff --git a/stl/micro/rack-mount/patchPanel_P.stl b/stl/micro/rack-mount/patchPanel_P.stl new file mode 100644 index 0000000..678fa14 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 new file mode 100644 index 0000000..4c3e9a1 Binary files /dev/null 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 new file mode 100644 index 0000000..19d2544 Binary files /dev/null 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 new file mode 100644 index 0000000..2e6ab6a Binary files /dev/null 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 new file mode 100644 index 0000000..2260e6e Binary files /dev/null and b/stl/micro/rack/eval_P.stl differ diff --git a/stl/micro/rack/feet_P.stl b/stl/micro/rack/feet_P.stl new file mode 100644 index 0000000..747959e Binary files /dev/null and b/stl/micro/rack/feet_P.stl differ diff --git a/stl/micro/rack/hingeModule.stl b/stl/micro/rack/hingeModule.stl new file mode 100644 index 0000000..5985a87 Binary files /dev/null and b/stl/micro/rack/hingeModule.stl differ diff --git a/stl/micro/rack/magnetModuleLeft_P.stl b/stl/micro/rack/magnetModuleLeft_P.stl new file mode 100644 index 0000000..695f6e9 Binary files /dev/null and b/stl/micro/rack/magnetModuleLeft_P.stl differ diff --git a/stl/micro/rack/magnetModuleRight_P.stl b/stl/micro/rack/magnetModuleRight_P.stl new file mode 100644 index 0000000..db17e05 Binary files /dev/null and b/stl/micro/rack/magnetModuleRight_P.stl differ diff --git a/stl/micro/rack/mainRail_P.stl b/stl/micro/rack/mainRail_P.stl new file mode 100644 index 0000000..aff246a Binary files /dev/null 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 new file mode 100644 index 0000000..59d11ad Binary files /dev/null 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 new file mode 100644 index 0000000..d32fa16 Binary files /dev/null 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 new file mode 100644 index 0000000..c7ceccf Binary files /dev/null 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 new file mode 100644 index 0000000..8baebb6 Binary files /dev/null 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 new file mode 100644 index 0000000..ab4c7de Binary files /dev/null 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 new file mode 100644 index 0000000..4a64ca4 Binary files /dev/null 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 new file mode 100644 index 0000000..ab131a7 Binary files /dev/null and b/stl/micro/rack/yBar_P.stl differ