Python + CadQuery workflow for generating homelab rack CAD models and assemblies.
This project is built for iterative rack planning:
- rack frame modeling
- U-position layout
- shelf and device placement
- clearance/collision adjustments
- CAD exports for AutoCAD/Fusion workflows
This repo includes a browser-based 3D viewer using <model-viewer>.
- Viewer page source:
docs/index.html - Web models:
docs/vevor_20u_loaded.glb(loaded rack + devices)docs/vevor_20u_rack.glb(frame only)
- Conversion script:
tools/convert_step_to_glb.py
python tools/convert_step_to_glb.pyThis converts:
models/vevor_20u_rack.step->docs/vevor_20u_rack.glbmodels/vevor_20u_loaded.step->docs/vevor_20u_loaded.glb
The viewer defaults to the loaded rack model and includes a button to switch to frame-only view.
- Open repo Settings -> Pages.
- Under Build and deployment, set Source to Deploy from a branch.
- Select branch
mainand folder/docs. - Save, then wait for publish.
Expected viewer URL:
https://mxioi.github.io/Homelab-Server-Rack-CAD-Generator/
models/vevor_20u_rack.step(full rack STEP model)models/vevor_20u_loaded.step(rack with modeled contents)models/vevor_20u_rack.stl(3D-viewable mesh model)
GitHub note:
- Click
models/vevor_20u_rack.stlin the repo to open GitHub's interactive 3D viewer.
Running the generator writes STEP/STL outputs to exports/.
Common files:
exports/vevor_20u_rack.stepexports/vevor_20u_loaded.stepexports/vevor_20u_rack_template.step
Recommended Python: 3.11 (project script creates an isolated .venv311).
./setup_and_generate.ps1Manual alternative:
py -3.11 -m venv .venv311
.\.venv311\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt
python generate_models.py- Generate exports with
python generate_models.py. - Import STEP files from
exports/into AutoCAD/Fusion. - Adjust dimensions/placements in
generate_models.py. - Regenerate and re-import for fit validation.
This repo intentionally keeps source-focused files:
generate_models.pyrequirements.txtsetup_and_generate.ps1README.mdmodels/vevor_20u_rack.stepandmodels/vevor_20u_rack.stl
Local/generated data (exports/, virtualenvs, caches) is excluded from version control.