L-system

Lindenmeyer system, also known as L-system, is a popular method in the field of tree generation and more generally in the field of procedural generation.

A L-system is defined by an initial state ( ) called axiom and by a set of production rules ( ). At every iteration the current state is rewritten according to the production rule.

A simple L-system

Consider the following example from [PL90], consisting of an alphabet of two symbols and two production rules . The first (resp. the second) stem transfrom every at from the current state into (resp. ).

Click on submit to see the resulting transformation. You can change the values with the form bellow.

From string rewriting to tree generation

From this grammar, we can generate geometric objects by interpreting the symbols as geometric instructions. For example, we can interpret the symbol as a move forward instruction and the symbol as a turn left instruction. The following table gives the interpretation of the symbols. The angle is a parameter of the system.

Table 1. alphabet

Symbol

Displacement

F

Move forward

f

Move forward without drawing

+

Turn left by angle

-

Turn right by angle

In this example, we generate a fractal from the previously defined alphabet.

To generate a tree, we can add the following symbols to the alphabet.

Table 2. extended alphabet
Symbol Displacement

[

Push the current state on the stack

]

Pop the current state from the stack

This symbols by saving and restoring the current state, allow to generate branching structures.

In practice

Although, L-systems are a powerful tool to generate complex structures, it is difficult to use them to generate tree with a given shape size. Indeed, the structure of the tree is determined by the production rules and the axiom. In the following section, we will study another method to generate tree with a given shape and size.