Convert architecture diagrams and LDraw brick scenes into clean, editable isometric SVG illustrations.
ldr2svg turns diagrams into isometric brick illustrations. Each node becomes a coloured 2×2 brick, clusters become raised platforms, and edges become arching arrows — all rendered as a single SVG you can edit in Inkscape, LibreOffice Draw, or drop straight into Google Slides.
Three input formats are supported:
| Format | Command | Example |
|---|---|---|
| diagrams Python scripts | diagram2svg |
uv run diagram2svg arch.py |
Mermaid flowcharts (.mmd) |
mermaid2svg |
uv run mermaid2svg arch.mmd |
LDraw / LeoCAD (.ldr) brick scenes |
ldr2svg |
uv run ldr2svg scene.ldr |
| Input — diagrams-library output | Output — isometric brick SVG | |
|---|---|---|
| → |
uv run diagram2svg arch.py -o arch_bricks.svguv run mermaid2svg arch.mmd -o arch_bricks.svguv run ldr2svg scene.ldrOutputs scene.svg alongside the input file.
| Tool | Purpose | Install |
|---|---|---|
| OpenSCAD | Render brick piece images | sudo apt install openscad |
| Graphviz | Lay out diagrams-library and Mermaid graphs (dot) |
sudo apt install graphviz |
| Xvfb | Virtual display for headless OpenSCAD | sudo apt install xvfb |
On macOS: brew install openscad graphviz (Xvfb not needed).
- Python 3.10+
- uv
uv syncuv run pytest test/ -m "not slow" # fast unit tests (no OpenSCAD needed)
uv run ruff check ldr2svg/ test/ # lint
uv run ty check ldr2svg/ # type checkSlow integration tests (require OpenSCAD; use xvfb-run on headless systems):
xvfb-run uv run pytest test/ -v- Load the SVG into a LibreOffice presentation (tested on LibreOffice 24.2.7.2)
- Click the image → contextual menu → Break the SVG
- Save as
.pptx(Microsoft PowerPoint 2007+) - Upload the
.pptxinto Google Slides
-
ldr2svg/brick.scad— derived from Thingiverse thing:5699, © 2015 Christopher Finke, MIT licence. -
LDraw — part geometry and colour definitions follow the LDraw open standard for Brick CAD programs. LDraw™ is a trademark of the Estate of James Jessiman.