A Python tool to generate 3D printable enclosures for LED matrix panels. Built with build123d.
This project is a work in progress. While it satisfies my own requirements, it might not be suitable for your specific needs. Feel free to fork and modify it to your needs.
- Supports multiple LED matrix panel sizes (8x8, 16x16, 32x8)
- Modular design allowing multiple panels to be connected together
- Customizable grid and diffuser for even light distribution
- Wire management slots for clean cable routing
- Robust mounting system with support pillars and borders
- Configurable parameters for fine-tuning the design
- Python 3.12+
- uv
- VSCode and the OCP CAD Viewer extension
# 1. Clone the repository
git clone https://github.com/pmuller/led-matrix-enclosure.git
# 2. First cd into the cloned directory
cd led-matrix-enclosure
# 3. Then sync dependencies
uv pip sync
# 4. Source the virtual environment
. .venv/bin/activate
The tool provides a CLI to generate enclosure models:
led-matrix-enclosure 16x16,16x16 32x8 --enclosure-layout 2x1
This will generate an enclosure for two 16x16 LED matrices arranged horizontally on the 1st row, and a 32x8 LED matrix on the 2nd row.
- LED Matrix Layout: Specify panel sizes and arrangement (e.g. "16x16,16x16" for two 16x16 panels)
- Enclosure Layout: Define how to split the enclosure into modules (e.g. "2x1" for 2 horizontal modules)
- Border Options: Customize border thickness, radius, and support ledge size
- Grid Options: Configure grid line heights and spacing
- Diffuser Options: Set diffuser thickness and margins
- Pillar Options: Adjust support pillar dimensions and spacing
Run with --help
to see all available options.
The tool generates assets in the build/
directory:
- STL files for the chassis components
- STEP files for the lid components (grid + diffuser)
The output files can be directly used with a 3D printer slicer.
In case you want to print an enclosure that is bigger than your printer bed,
you can split the enclosure into multiple parts using the --enclosure-layout
option.
For example, to split the enclosure into 2 horizontal parts, you can run:
led-matrix-enclosure 16x16,16x16 32x8 --enclosure-layout 2x1
This will generate 1 STL and 1 STEP file for each module in the build/
directory:
module:x=0,y=0.chassis.stl
module:x=0,y=0.lid.step
module:x=160,y=0.chassis.stl
module:x=160,y=0.lid.step
You can then print each part separately and assemble them together using M3 screws and nuts.
-
Follow the Installation section to set up the development environment.
-
Run tests:
pytest -vvv
This project is licensed under the MIT License - see the LICENSE file for details.
Built with build123d - An awesome Python CAD library.