Automates the creation of personalized LEGO-style name bricks using OpenSCAD and the template LEGOTextBrick-v2p1.scad.
- Python 3.8+ (standard library only, no extra packages needed)
- OpenSCAD — download from openscad.org
- On Windows, prefer using
openscad.com(the console binary) for CLI use
- On Windows, prefer using
- The Python script reads a CSV (
Vorname,Nachname,OE) and generates a per-entry wrapper.scad. - The wrapper imports only the
brick()module viause <LEGOTextBrick-v2p1.scad>and defines local text modules (makeFrontText,makeBackText,makeLeftText,makeRightText) so they can see the wrapper variables. (This is required becauseusedoes not share globals between files.) - Text is recessed on all sides.
- Font is fixed to Roboto:style=Black.
.
├── LEGOTextBrick-v2p1.scad # OpenSCAD template (CC BY-SA 4.0, by Lyl3)
├── make_bricks.py # Generator script (MIT)
├── dummy.csv # Example input (German headers)
├── LICENSE # License information
├── CONTRIBUTING.md
├── SECURITY.md
└── stl_out/ # STL output directory (gitignored, created on first run)
Headers (German):
Vorname,Nachname,OE
Example (dummy.csv):
Vorname,Nachname,OE
Anna,Müller,1.2
Jonas,Schmidt,2.3.4
Lena,Becker,3
python make_bricks.py \
--csv dummy.csv \
--template LEGOTextBrick-v2p1.scad \
--outdir stl_out \
--openscad openscadOn Windows with a local OpenSCAD install, point --openscad to the .com binary:
python make_bricks.py --csv dummy.csv --template LEGOTextBrick-v2p1.scad --outdir stl_out --openscad "C:\Program Files\OpenSCAD\openscad.com"| Flag | Default | Description |
|---|---|---|
--keep-scad |
off | Keep intermediate wrapper .scad files |
STLs are named <OE>_<Nachname>_<Vorname>.stl:
1.2_Mueller_Anna.stl
2.3.4_Schmidt_Jonas.stl
3_Becker_Lena.stl
| Parameter | Value |
|---|---|
| Brick size | 8 x 4 x 3 studs |
| Studs | top only |
| Text style | recessed on all sides |
| Text size | 5.5 mm |
| Text depth | 0.8 mm |
| Font | Roboto:style=Black |
To change defaults, edit PROJECT_CFG at the top of make_bricks.py.
use <...>is intentionally used instead ofinclude <...>to avoid executing the template's own defaults. The wrapper re-creates the top-level geometry and calls the locally defined text modules so your variables apply correctly.- OpenSCAD must have the Roboto font installed, or you must change
selectedFontin the script.
LEGOTextBrick-v2p1.scad: CC BY-SA 4.0 — original work by Lyl3- Everything else (
make_bricks.py,dummy.csv, documentation): MIT