• Home
  • Bread
    • Amsterdam
    • Bangalore
    • Berlin
    • Bologna
    • Bozeman
    • Budapest
    • Chicago
    • Côte d'Azur
    • Goa
    • Lima
    • Lisbon
    • Lofoten Islands
    • London
    • Los Angeles
    • Málaga
    • Marseille
    • Mexico City
    • Modena
    • Montreal
    • Mumbai
    • New Mexico
    • New York City
    • Oslo
    • Paris
    • Porto
    • Reykjavík
    • Rome
    • San Francisco
    • Santiago de Chile
    • Singapore
    • Turin
    • Valencia
    • Zagreb
  • About
Menu

disquiet

Decadence is the total loss of unconsciousness, which is the very basis of life. Could it think, the heart would stop beating.
  • Home
  • Bread
  • Places
    • Amsterdam
    • Bangalore
    • Berlin
    • Bologna
    • Bozeman
    • Budapest
    • Chicago
    • Côte d'Azur
    • Goa
    • Lima
    • Lisbon
    • Lofoten Islands
    • London
    • Los Angeles
    • Málaga
    • Marseille
    • Mexico City
    • Modena
    • Montreal
    • Mumbai
    • New Mexico
    • New York City
    • Oslo
    • Paris
    • Porto
    • Reykjavík
    • Rome
    • San Francisco
    • Santiago de Chile
    • Singapore
    • Turin
    • Valencia
    • Zagreb
  • About
fractal-plants-bottom-three.png

Fractal Plants

November 26, 2019
 
A fractal plant generated using axiom F, production rule F → FF-[-F+F+F]+[+F-F-F], for 6 iterations, with a turn angle of 22.5°,

A fractal plant generated using axiom F, production rule F → FF-[-F+F+F]+[+F-F-F], for 6 iterations, with a turn angle of 22.5°,

The other day I was looking at implementations to the Hilbert Curve, and came across this concise and elegant recursive solution. I also came across the L-system, or Lindenmayer system. Lindenmayer, a biologist and botanist, developed the L-system to model the growth processes of plant development.

Wikipedia’s explanation of L-systems is succinct and clear:

An L-system consists of an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into some larger string of symbols, an initial "axiom" string from which to begin construction, and a mechanism for translating the generated strings into geometric structures.

A simple way to understand the L-system is to use Lindenmayer’s original L-system for modeling algae growth.

variables : A B
constants : none
axiom : A
rules : (A → AB), (B → A)

which produces:

n = 0 : A
n = 1 : AB
n = 2 : ABA
n = 3 : ABAAB
n = 4 : ABAABABA
n = 5 : ABAABABAABAAB
n = 6 : ABAABABAABAABABAABABA
n = 7 : ABAABABAABAABABAABABAABAABABAABAAB

The L-system is both simple and incredibly flexible. The L-system is a parallel rewriting system that isn’t opinionated about what the symbols mean or do. But what if we gave these symbols meaning? For example, we can use the L-system in graphics by mapping individual symbols in the model to drawing commands.

Consider the Hilbert Curve:

variables : A B
constants : none
axiom : A
rules : (A → LBFRAFARFBR), (B → RAFLBFBLFAR)

which produces:

n = 0 : A
n = 1 : LBFRAFARFBL
n = 2 : LRAFLBFBLFARFRLBFRAFARFBLFLBFRAFARFBLRFRAFLBFBLFARL
n = 3 : LRLBFRAFARFBLFLRAFLBFBLFARFRAFLBFBLFARLFLBFRAFARFBLRFRLRAFLBFBLFARFRLBFRAFARFBLFLBFRAFARFBLRFRAFLBFBLFARLFLRAFLBFBLFARFRLBFRAFARFBLFLBFRAFARFBLRFRAFLBFBLFARLRFRLBFRAFARFBLFLRAFLBFBLFARFRAFLBFBLFARLFLBFRAFARFBLRL

Now what if we mapped some of the symbols in the Hilbert L-system to drawing functions?

F → move forward
L → turn left 90°
R → turn right 90°

For various iterations (n=1 through n=4), we end up with the following patterns:

Hilbert curves for n=1 through n=4 iterations

Hilbert curves for n=1 through n=4 iterations

 
 
fractal-plants-all.png
 

We can use this same process to generate various plant structures! None of the fractal plants presented here are novel. In fact, the production rules for these plants are well documented in Lindenmayer’s classic Algorithmic Beauty of Plants. The collage above is more or less the same as in page 25 of the same book, except that I generated my plants with higher iterations, and randomized the color for each stroke between two shades of green. I generated these using a rudimentary TypeScript implementation of L-system that I wrote and Canvas.

I don’t know how these plants should be named, so I’m just using the entire description of each one’s axiom, production rules, turn angle and iterations.

 
 

n=8, δ = 25.7°, F, F → F[+F]F[-F]F

fractal-plant-5.png
 
 

n = 8, δ = 20°, F, F → F[+F]F[-F][F]

fractal-plant-4.png
 
 

n = 6, δ = 22.5°, F, F → FF-[-F+F+F]+[+F-F-F]

fractal-plant.png
 
 

n = 11, δ = 20°,X, X → F[+X]F[-X]+X, F → FF

fractal-plant-6.png
 
 

n = 11, δ = 25.7° , X, F, X → F[+X][-X]FX, F → FF

fractal-plant-2.png
 
 

n = 9, δ = 22.5°, X, F, X → F-[[X]+X]+F[+FX]-X, F → FF

fractal-plant-3.png
 
More Posts With Code
fractal-plants-bottom-three.png
November 26, 2019
Fractal Plants
November 26, 2019
Read more →
November 26, 2019
i-colored-pastel.png
October 31, 2019
I at the Center
October 31, 2019
Read more →
October 31, 2019
Tags plants, fractals, code, tech, typescript, l-system, lindenmayer
← The Year in Crumbs: Good Sourdough in 2019I at the Center →

Latest Posts

Featured
S443397-R1-059-28.jpg
July 30, 2026
San Francisco, Spring 2026
July 30, 2026
Read more →
July 30, 2026
000052370028.jpg
June 17, 2026
Marseille in film, Mar 2026
June 17, 2026
Read more →
June 17, 2026
000387250014.jpg
April 19, 2026
Paris in film, Feb 2026
April 19, 2026
Read more →
April 19, 2026
L1000835.jpg
January 1, 2026
The Year in Crumbs: Good Sourdough in 2025
January 1, 2026
Read more →
January 1, 2026
S027576-R1-021-9.jpg
December 22, 2025
Oslo and Paris on film, Summer 2025
December 22, 2025
Read more →
December 22, 2025
S811577-R1-012-4A.jpg
October 5, 2025
Lofoten in Film, May 2025
October 5, 2025
Read more →
October 5, 2025
L1009983-2.jpg
January 1, 2025
The Year in Crumbs: Good Sourdough in 2024
January 1, 2025
Read more →
January 1, 2025
DSCF0348.jpg
November 19, 2024
Dining in Lima, Peru: Central (No. 1, The World's 50 Best 2023)
November 19, 2024
Read more →
November 19, 2024
DSCF0302.jpg
October 19, 2024
Dining in Málaga, Spain: Kaleja ⭐
October 19, 2024
Read more →
October 19, 2024
04470022.jpg
October 15, 2024
Fujicolor Pro 400H: Bozeman, Catskills and Santiago de Chile
October 15, 2024
Read more →
October 15, 2024

All text and photos © 2017 – 2021 Premshree Pillai, unless otherwise mentioned.

~ fin ~