L system
Introduction


return to main index



Introduction

Lindenmayer systems, aka Lsystems, are based on the pioneering research of Aristid Lindenmayer. The principles they embody were first applied to graphics by Przemyslaw Prusinkiewicz. In addition to generating organic/branching forms such as plants, Lsystems have also been adapted, more recently and with intriguing results, by architects. Wikipedia has many fascinating examples of Lsystems.

Modeling with an Lsystem is entirely different to using an interactive package where an artist directly models each detail of a scene. In contrast to the explicit interactive approach, shapes emerge from an Lsystem as a result of an artist changing the rules by which a sequence of characters, known as an Lstring, are generated and interpreted.

For example, the lattice shown in figure 1 was generated by a sequence of characters. The lattice was made by replacing each '1' in following input string, called the axiom,
      "1<z1<z1<z1"
by a sequence of substitution characters.
      "11<z1>z1<z1<z11"

The substitutions shown above defines a rule that says, "all instances of the character '1' in an input string must be replaced by the characters of a replacement string". In other words,

    find each     and replace it with
       "1"         "11<z1>z1<z1<z11"

This produces longer sequence of characters called a Lstring. For example,
      11<z1>z1<z1<z11<x11<z1>z1<z1<z11<
      z11<z1>z1<z1<z11<x11<z1>z1<z1<z11

If the characters are again substituted a second generation Lstring is generated. For example,
      11<z1>z1<z1<z1111<z1>z1<z1<z11<z11<z1>z1<z1<z11>z
      11<z1>z1<z1<z11<z11<z1>z1<z1<z11<z11<z1>z1<z1<z11
      11<z1>z1<z1<z11<z11<z1>z1<z1<z1111<z1>z1<z1<z11<z
      11<z1>z1<z1<z11>z11<z1>z1<z1<z11<z11<z1>z1<z1<z11
      <z11<z1>z1<z1<z1111<z1>z1<z1<z11<z11<z1>z1<z1<z11
      11<z1>z1<z1<z11<z11<z1>z1<z1<z11>z11<z1>z1<z1<z11
      <z11<z1>z1<z1<z11<z11<z1>z1<z1<z1111<z1>z1<z1<z11
      <z11<z1>z1<z1<z1111<z1>z1<z1<z11<z11<z1>z1<z1<z11
      >z11<z1>z1<z1<z11<z11<z1>z1<z1<z11<z11<z1>z1<z1<
      z1111<z1>z1<z1<z11


Figure 1


Interpretation

After an Lstring has been generated it is post-processed as if it were a long sequence of instructions. Figure 1 was produced, in Maya, as a result of interpreting the characters '1', '<', '>' and 'z' to mean the following,.


  '1'   insert a straight line (curve), and move
        the coordinate system to the end of the line
  '>'   make subsequent rotations positive
  '<'   make subsequent rotations negative
  'z'   rotate around the z-axis of the current
        coordinate system"


The characters in a Lstring generally insert geometry into a 3D scene or alter the coordinate system into which the geometry will be placed. There are, however, other ways in which the Lstring can be interpreted. The symbols in an Lstring could generate instructions for a MIDI system, or they could form form the basis of dance choreography.


Lsystem Terminology


Lstring a long sequence of (keyboard) characters.
axiom a initial string from which an Lstring is generated.
string rewriting a number of rules that identify which characters should be replaced (rewritten) by other characters.
generation - the number of times string rewriting occurs.
string interpretation - the geometric operations assigned to the characters in an Lstring.





© 2002- Malcolm Kesson. All rights reserved.