Skip to content

MvdB/OrgBricks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LEGO Text Brick Generator

Automates the creation of personalized LEGO-style name bricks using OpenSCAD and the template LEGOTextBrick-v2p1.scad.

Prerequisites

  • 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

How it works

  • The Python script reads a CSV (Vorname,Nachname,OE) and generates a per-entry wrapper .scad.
  • The wrapper imports only the brick() module via use <LEGOTextBrick-v2p1.scad> and defines local text modules (makeFrontText, makeBackText, makeLeftText, makeRightText) so they can see the wrapper variables. (This is required because use does not share globals between files.)
  • Text is recessed on all sides.
  • Font is fixed to Roboto:style=Black.

Repository structure

.
├── 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)

CSV format

Headers (German):

Vorname,Nachname,OE

Example (dummy.csv):

Vorname,Nachname,OE
Anna,Müller,1.2
Jonas,Schmidt,2.3.4
Lena,Becker,3

Usage

python make_bricks.py \
  --csv dummy.csv \
  --template LEGOTextBrick-v2p1.scad \
  --outdir stl_out \
  --openscad openscad

On 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"

Optional flags

Flag Default Description
--keep-scad off Keep intermediate wrapper .scad files

Output naming

STLs are named <OE>_<Nachname>_<Vorname>.stl:

1.2_Mueller_Anna.stl
2.3.4_Schmidt_Jonas.stl
3_Becker_Lena.stl

Defaults (per project)

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.

Notes

  • use <...> is intentionally used instead of include <...> 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 selectedFont in the script.

License

  • LEGOTextBrick-v2p1.scad: CC BY-SA 4.0 — original work by Lyl3
  • Everything else (make_bricks.py, dummy.csv, documentation): MIT

About

Generate personalized LEGO-style name bricks (STL) from a CSV using OpenSCAD

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors