Understanding LSVG (L-System Vector Generator) rules

by Dmitry Malutin, 2004

What are L-system fractals?

An L-system is a method used to model growth processes. They are named after Aristid Lindenmayer, who was the first to use them to model the growth of plants.

L-systems consist of an axiom (a simple string like "F"), and a set of production rules (such as "F=F-F++F-F"), and also an alphabet of symbols which have some pre-defined meaning and interpretation. The axiom is recursively expanded a fixed number of times according to the rules, after which a long string is generated.

Using the example above, the expansions would be:

Axiom: F
Rules: F = F-F++F-F

Level 0: F
Level 1: F-F++F-F
Level 2: F-F++F-F-F-F++F-F++F-F++F-F-F-F++F-F
Level 3: F-F++F-F-F-F++F-F++F-F++F-F-F-F++F-F-F-F++F-F-F-F++F-F++F-F++F-F-F-F++F-F++F-F++F-F-F-F++F-F++F-F++F-F-F-F++F-F-F-F++F-F-F-F++F-F++F-F++F-F-F-F++F-F

This long string by itself is useless unless some meaning or interpretation is made of it's symbols.

Traditionally, "F" means to go forward (drawing a line from the current point to the next point), while "+" and "-" mean to turn (right or left).
"[" and "]" are used to store and restore position and angle. For a full description of all the symbols, see table below
.

Using an axiom and a few rules, it is possible to construct very complex and interesting fractals.

LSVG Commands

Symbol Meaning
F Move forward while drawing a line
+ Turn right A degrees, where A is the L-system turn angle.
- Turn left A degrees, where A is the L-system turn angle.
[ Saves the current state (including x,y position and direction). You may wish to think of this as pushing the current state on a stack.
] Restores the previous state saved by a ]. You may wish to think of this as popping the previous state off the stack.

Process is illustrated on picture below.

 

General  notes:

  1. You can create only 6 rules..
  2. Unknown characters are ignored.

The best way to learn about L-systems are to experiment and try your own. In addition, the Fractint L-systems tutorial by William McWorter is highly recommended.


Credits and Contact

LSVG was written by Dmitry Malutin.

Part of this file and part of LSVG fractal presets are taken from L-system Explorer written by Ron Coscorrosa