| name | lsystem-executor |
| description | Execute L-system and shape grammars to produce visual derivations, SVG/PNG renders, and optional STL meshes |
| metadata | null |
L-System Executor
Execute parametric L-system grammars and render the results as images or meshes.
Overview
Takes a grammar definition (axiom + rewrite rules) and produces:
- Step-by-step derivation showing the string at each iteration
- 2D turtle-graphics rendering as SVG and PNG
- Optional 3D extrusion to STL (if
--stl flag is passed)
Useful for investigations that produce symbolic growth grammars (urban evolution,
microstructure growth, biological branching) and need a concrete visual artifact.
Usage
From a JSON grammar file:
python3 {baseDir}/scripts/lsystem_render.py --grammar grammar.json --steps 4 --output output_dir/
Inline grammar:
python3 {baseDir}/scripts/lsystem_render.py \
--axiom "A" \
--rules '{"A": "A[+B]A[-B]A", "B": "BB"}' \
--angle 25 \
--steps 4 \
--output output_dir/
With STL export:
python3 {baseDir}/scripts/lsystem_render.py \
--grammar grammar.json \
--steps 3 \
--stl \
--output output_dir/
Grammar JSON Format
{
"axiom": "A",