add animation gifs for new rack-mount systems, also update rbuild and the main readme to reflect these changes
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,6 +7,6 @@
|
|||||||
!/stl/micro/
|
!/stl/micro/
|
||||||
!/stl/nano/
|
!/stl/nano/
|
||||||
|
|
||||||
/assembly-guide/gifs/tmp
|
**/tmp/
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@ -63,11 +63,11 @@ but beware of PLA's thermal limits. Higher infill is recommended for all parts.
|
|||||||
|
|
||||||
## Trays, Boxes, etc
|
## Trays, Boxes, etc
|
||||||
|
|
||||||
Some parametric rack mount items can be found in [rack-mount](./rack-mount). The following rack-mount systems
|
Some parametric rack mount systems can be found in [rack-mount](./rack-mount). The following rack-mount systems
|
||||||
are currently supported:
|
are currently supported:
|
||||||
- [Enclosed Box](./rack-mount/enclosed-box/entry.scad): For mounting box-shaped objects, without the need for any mounting holes on the box.
|
- [Enclosed Box](./rack-mount/enclosed-box): For mounting box-shaped objects, without the need for any mounting holes on the box.
|
||||||
- [Tray](./rack-mount/tray/entry.scad): Simple tray mounted using only the front rails. Can be configured to have screw mounts at the bottom of the tray.
|
- [Tray](./rack-mount/tray): Simple tray mounted using only the front rails. Can be configured to have screw mounts at the bottom of the tray.
|
||||||
- [Patch Panel](./rack-mount/patch-panel/entry.scad): Linear patch panel array. Number of keystone slots can be configured.
|
- [Patch Panel](./rack-mount/patch-panel): Linear patch panel array. Number of keystone slots can be configured.
|
||||||
|
|
||||||
|
|
||||||
## Configuring + Generating STLs
|
## Configuring + Generating STLs
|
||||||
|
|||||||
12
rack-mount/enclosed-box/README.md
Normal file
12
rack-mount/enclosed-box/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Enclosed Box Mounting System
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Please see [entry.scad](./entry.scad) for config and building. Make sure the correct rack profile is configured in [rackFrame.scad](../../config/rackFrame.scad).
|
||||||
|
|
||||||
|
- This system comprises three parts: two side rails, and a front plate.
|
||||||
|
- This system is useful for mounting heavier box-shaped things. It works by first sliding in the box inside the side rails (which secures `x`, `z`, and one half of the `y` axis), and then mounting the front plate along the main rails.
|
||||||
|
- Side rails will most likely require supports to print.
|
||||||
|
- For wider boxes (nearing the `maxUnitWidth` of the rack), you will have to set `recessSideRail` to true. This is so the side rails will not collide with the main rack rails.
|
||||||
BIN
rack-mount/enclosed-box/animate.gif
Normal file
BIN
rack-mount/enclosed-box/animate.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
9
rack-mount/patch-panel/README.md
Normal file
9
rack-mount/patch-panel/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Patch Panel
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Please see [entry.scad](./entry.scad) for config and building. Make sure the correct rack profile is configured in [rackFrame.scad](../../config/rackFrame.scad).
|
||||||
|
|
||||||
|
- Mount RJ-45 Keystone jacks with this part.
|
||||||
|
- Single part. Can be printed without supports.
|
||||||
BIN
rack-mount/patch-panel/animate.gif
Normal file
BIN
rack-mount/patch-panel/animate.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
9
rack-mount/tray/README.md
Normal file
9
rack-mount/tray/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Tray Mounting System
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Please see [entry.scad](./entry.scad) for config and building. Make sure the correct rack profile is configured in [rackFrame.scad](../../config/rackFrame.scad).
|
||||||
|
|
||||||
|
- Mount on front rails.
|
||||||
|
- Single Part, can also be printed without supports.
|
||||||
|
- Includes support for custom bottom screws (`mountPoints` in config). This is useful for SBCs and mini PCs with bottom screws.
|
||||||
BIN
rack-mount/tray/animate.gif
Normal file
BIN
rack-mount/tray/animate.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
@ -16,5 +16,5 @@ module animateTraySystem(at=$t) {
|
|||||||
dx = abs(lerp(a=-40, b=40, t=at));
|
dx = abs(lerp(a=-40, b=40, t=at));
|
||||||
dy = abs(lerp(a=-30, b=30, t=at));
|
dy = abs(lerp(a=-30, b=30, t=at));
|
||||||
|
|
||||||
traySystem(trayU=trayU, baseWidth=x+dx, baseDepth=y+dy, mountPoints=[]);
|
traySystem(trayU=trayU, baseWidth=x+dx, baseDepth=y+dy, mountPoints=[], backLipHeight=8);
|
||||||
}
|
}
|
||||||
62
rbuild.py
62
rbuild.py
@ -20,11 +20,9 @@ class BuildSizeConfig:
|
|||||||
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
|
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
RACK_BUILD_DIR = os.path.join(FILE_DIR, 'rack/print')
|
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')
|
BUILD_PARENT_DIR = os.path.join(FILE_DIR, 'stl')
|
||||||
|
RACK_MOUNT_DIR = os.path.join(FILE_DIR, 'rack-mount')
|
||||||
RACK_BUILD_TARGET_SUB_DIR = 'rack'
|
RACK_BUILD_TARGET_SUB_DIR = 'rack'
|
||||||
RACK_MOUNT_BUILD_TARGET_SUB_DIR = 'rack-mount'
|
|
||||||
|
|
||||||
ASSEMBLY_GIF_DIR = os.path.join(FILE_DIR, 'rack/assembly')
|
ASSEMBLY_GIF_DIR = os.path.join(FILE_DIR, 'rack/assembly')
|
||||||
ASSEMBLY_GIF_BUILD_DIR = os.path.join(FILE_DIR, 'assembly-guide/gifs')
|
ASSEMBLY_GIF_BUILD_DIR = os.path.join(FILE_DIR, 'assembly-guide/gifs')
|
||||||
@ -49,6 +47,11 @@ ASSEMBLY_STEPS = [
|
|||||||
('attachXYPlates.scad', 16)
|
('attachXYPlates.scad', 16)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
MOUNT_ANIMATIONS = [
|
||||||
|
('enclosed-box', 32),
|
||||||
|
('tray', 32),
|
||||||
|
('patch-panel', 32)
|
||||||
|
]
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if not assertOpenscadExists():
|
if not assertOpenscadExists():
|
||||||
@ -97,9 +100,9 @@ def main():
|
|||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--build_assembly_gifs',
|
'--build_gifs',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Generate the GIFS for the assembly guide.'
|
help='Generate the GIFS for the assembly guide, as well as various rack-mount systems.'
|
||||||
)
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -115,11 +118,12 @@ def run_build(args):
|
|||||||
build_gifs = args.build_assembly_gifs
|
build_gifs = args.build_assembly_gifs
|
||||||
|
|
||||||
if (build_var is not None) == (build_gifs is True):
|
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)")
|
print("Please either provide the build (-b) variable, or the build-gifs option (--build-gifs)")
|
||||||
return
|
return
|
||||||
|
|
||||||
if build_gifs:
|
if build_gifs:
|
||||||
build_assembly_gifs(config_var, dz, nightly)
|
build_assembly_gifs(config_var, dz, nightly)
|
||||||
|
build_rack_mount_gifs(config_var, nightly)
|
||||||
return
|
return
|
||||||
|
|
||||||
if target_var != "":
|
if target_var != "":
|
||||||
@ -128,38 +132,25 @@ def run_build(args):
|
|||||||
final_target_directory_name = config_var
|
final_target_directory_name = config_var
|
||||||
|
|
||||||
rackBuildDirFull = os.path.join(BUILD_PARENT_DIR, final_target_directory_name, RACK_BUILD_TARGET_SUB_DIR)
|
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)
|
|
||||||
|
|
||||||
if not os.path.exists(rackBuildDirFull):
|
if not os.path.exists(rackBuildDirFull):
|
||||||
os.makedirs(rackBuildDirFull)
|
os.makedirs(rackBuildDirFull)
|
||||||
|
|
||||||
#if not os.path.exists(rackMountBuildDirFull):
|
|
||||||
# os.makedirs(rackMountBuildDirFull)
|
|
||||||
|
|
||||||
if build_var == 'all':
|
if build_var == 'all':
|
||||||
for dir_file in os.listdir(RACK_BUILD_DIR):
|
for dir_file in os.listdir(RACK_BUILD_DIR):
|
||||||
build_single(RACK_BUILD_DIR, rackBuildDirFull, dir_file, config_var, dz, nightly)
|
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)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
filename_rack = find_rack(build_var)
|
filename_rack = find_rack(build_var)
|
||||||
#filename_rack_mount = find_rack_mount(build_var)
|
|
||||||
|
|
||||||
if not (filename_rack): #or filename_rack_mount):
|
if not (filename_rack):
|
||||||
print('File:', build_var, 'not found!')
|
print('File:', build_var, 'not found!')
|
||||||
return
|
return
|
||||||
|
|
||||||
if filename_rack:
|
if filename_rack:
|
||||||
build_single(RACK_BUILD_DIR, rackBuildDirFull, filename_rack, config_var, dz, nightly)
|
build_single(RACK_BUILD_DIR, rackBuildDirFull, filename_rack, config_var, dz, nightly)
|
||||||
|
|
||||||
#if filename_rack_mount:
|
|
||||||
# build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, filename_rack_mount, config_var, dz, nightly)
|
|
||||||
|
|
||||||
|
|
||||||
def build_single(build_dir, target_dir, filename, config, dz, nightly):
|
def build_single(build_dir, target_dir, filename, config, dz, nightly):
|
||||||
print('Building:', filename, 'from', build_dir, 'to', target_dir)
|
print('Building:', filename, 'from', build_dir, 'to', target_dir)
|
||||||
openscad_args = construct_openscad_args(build_dir, target_dir, filename, config, dz)
|
openscad_args = construct_openscad_args(build_dir, target_dir, filename, config, dz)
|
||||||
@ -169,18 +160,39 @@ def build_single(build_dir, target_dir, filename, config, dz, nightly):
|
|||||||
def build_assembly_gifs(config, dz, nightly):
|
def build_assembly_gifs(config, dz, nightly):
|
||||||
print('Building assembly-gifs. Source Dir:', ASSEMBLY_GIF_DIR, '| Target:', ASSEMBLY_GIF_BUILD_DIR)
|
print('Building assembly-gifs. Source Dir:', ASSEMBLY_GIF_DIR, '| Target:', ASSEMBLY_GIF_BUILD_DIR)
|
||||||
|
|
||||||
|
if not os.path.exists(ASSEMBLY_GIF_TEMP_DIR):
|
||||||
|
os.makedirs(ASSEMBLY_GIF_TEMP_DIR)
|
||||||
|
|
||||||
for (fileName, numSteps) in ASSEMBLY_STEPS:
|
for (fileName, numSteps) in ASSEMBLY_STEPS:
|
||||||
print('Building GIF for', fileName)
|
print('Building GIF for', fileName)
|
||||||
openscad_args = construct_openscad_animation_args(
|
openscad_args = construct_openscad_animation_args(
|
||||||
ASSEMBLY_GIF_DIR, ASSEMBLY_GIF_TEMP_DIR, fileName, config, dz, numSteps
|
ASSEMBLY_GIF_DIR, ASSEMBLY_GIF_TEMP_DIR, fileName, config, dz, numSteps
|
||||||
)
|
)
|
||||||
run_openscad(openscad_args, nightly)
|
run_openscad(openscad_args, nightly)
|
||||||
build_gif_from_png(fileName)
|
build_gif_from_png(fileName, ASSEMBLY_GIF_TEMP_DIR, ASSEMBLY_GIF_BUILD_DIR)
|
||||||
|
|
||||||
|
def build_rack_mount_gifs(config, nightly):
|
||||||
|
print('Building GIFs for rack-mounts systems')
|
||||||
|
|
||||||
|
for (system, numSteps) in MOUNT_ANIMATIONS:
|
||||||
|
print('Building GIF for', system)
|
||||||
|
system_dir = os.path.join(RACK_MOUNT_DIR, system)
|
||||||
|
temp_dir = os.path.join(system_dir, 'tmp')
|
||||||
|
|
||||||
|
if not os.path.exists(temp_dir):
|
||||||
|
os.makedirs(temp_dir)
|
||||||
|
|
||||||
|
openscad_args = construct_openscad_animation_args(system_dir, temp_dir, 'animate.scad', config, 10, numSteps)
|
||||||
|
run_openscad(openscad_args, nightly)
|
||||||
|
build_gif_from_png('animate', temp_dir, system_dir)
|
||||||
|
|
||||||
|
def build_gif_from_png(fileName, source, target):
|
||||||
|
|
||||||
|
if not os.path.exists(target):
|
||||||
|
os.makedirs(target)
|
||||||
|
|
||||||
def build_gif_from_png(fileName):
|
|
||||||
try:
|
try:
|
||||||
subprocess.run(["bash", BUILD_GIF_FROM_PNG_SCRIPT, fileName, ASSEMBLY_GIF_TEMP_DIR, ASSEMBLY_GIF_BUILD_DIR],
|
subprocess.run(["bash", BUILD_GIF_FROM_PNG_SCRIPT, fileName, source, target],
|
||||||
check=True)
|
check=True)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print(f"Error calling shell script: {e}")
|
print(f"Error calling shell script: {e}")
|
||||||
@ -224,10 +236,6 @@ def find_rack(filename):
|
|||||||
return find_scad_file(RACK_BUILD_DIR, filename)
|
return find_scad_file(RACK_BUILD_DIR, filename)
|
||||||
|
|
||||||
|
|
||||||
#def find_rack_mount(filename):
|
|
||||||
# return find_scad_file(RACK_MOUNT_BUILD_DIR, filename)
|
|
||||||
|
|
||||||
|
|
||||||
def find_scad_file(directory, filename):
|
def find_scad_file(directory, filename):
|
||||||
for dir_file in os.listdir(directory):
|
for dir_file in os.listdir(directory):
|
||||||
dir_file_normalized = dir_file.lower()
|
dir_file_normalized = dir_file.lower()
|
||||||
|
|||||||
Reference in New Issue
Block a user