L-System Plants illustration

L-System Plants

An L-system grows a plant from a handful of rewriting rules. Starting from a short axiom, every symbol is replaced simultaneously by its rule, and after a few rounds the long resulting string is read as turtle graphics: draw forward, turn left or right, and push or pop a branch point. Pick a grammar — a Barnsley fern, a bushy tree, seaweed, a twiggy tree or a stochastic tree that chooses its rules at random — and tune the iteration count, branch angle, a seeded per-branch angle jitter and the growth speed. The plant draws on progressively, trunk before twigs, with stroke width tapering along each limb and colour shifting from brown bark to green tips, with leaves dotted at the branch ends. Once fully grown it sways in a gentle procedural breeze. Export any frame as a PNG; the status line reports the segment count and grammar.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • Aristid Lindenmayer introduced L-systems in 1968 to model the development of simple organisms; unlike ordinary grammars they rewrite every symbol in parallel, mirroring cells that divide simultaneously.
  • A grammar of a few characters unfolds into thousands of segments because each iteration expands the string roughly exponentially, producing self-similar, fractal branching structure.
  • Adding random rule choices or angle jitter — the stochastic and context-sensitive extensions catalogued in Prusinkiewicz and Lindenmayer’s The Algorithmic Beauty of Plants — breaks perfect self-similarity and makes the plants look convincingly natural.
  • Runs 100% in your browser — simulations are computed locally on your device.