João Freitas

On Lindenmayer Systems

Yesterday I learned about Lindenmayer Systems (L-System) through Gil Durão talk at Flutter Talk Porto 2023. It’s a formal specification of a grammar primarly used to model bacteria, algae, plants and tree growth, as originally proposed by Aristid Lindenmayer.

At its core there are three components:

G=⟨V,ω,P⟩

The goal behind these systems is to specify finite or infinite strings, which are constructed iteratively by applying the production rules to the symbols from the previous iteration. Using the example above:

Production rules specify the class/type of L-Systems, with the simplest one being D0L-system (deterministic and context-free L-System), which are represented by functions that take symbols as input and deterministically map them to other symbols as output. You can learn more about different classes on this article.


Okay, but what exactly can we use L-Systems for?

While many people use them to generate fractals (because fractals are cool), you can also use L-Systems to leverage your procedural generation game:

Gil prepared a demo of using L-Systems to generate fractals with Flutter. You can check it out here. Also, his presentation is free, so be sure to grab it!

gif of a l-system describing a growing plant

Source: https://www.memcode.com/courses/1177