| main | forward |
|
Introduction This page is an overview and introduction to Lindenmayer- (L-) Systems with some examples. First we will show some easy to understand samples creating squares, stars etc. Then we will move on to the famous Koch-, Hilbert-, Dragon- curve and finish by creating real plants, always using the Lindenmayer formalism. In 1968, Aristid Lindenmayer introduced this formalism especially for modeling and simulating the development of plants. L- Systems are also used in computer graphics to generate complex images from simple rules, for example fractal objects (Koch, Hilbert, Dragon- curve). As you will see, it is very closely related to formal languages. The easiest way to imagine the rules of L- systems is by using pictures and the most common way to paint them is Turtle graphic. Entering the depth of derivation, an angle factor, a starting string (Axiom) and the production rules, the application starts drawing your input. We use a nice java applet which starts drawing the first iteration, when you click on it and so on. In the section "Play yourself" where you can experiment with your own set of rules. The L-System Let us show you a very simple example of a production system: Axiom : A Angle : 45° Rule 1: A=BF Rule 2: B=FA
It is also possible to turn the turtle: " +" means turn left 45° (specified with the Angle in the production system). "-" means turn right.Furthermore by using " [" we can save a position and direction of the turtle and return to the last saved by "]". This function is very important for creating real plants.In our pages we relate on the syntax below: Typical Set of Commands: here the syntax used in L-System 5 by Timothy C. Perz
Drawing:
F Draw full unit
Z Draw half unit
Movement:
f Move full unit
z Move half unit
Orientation:
+ Turn left
- Turn right
& Pitch down
^ Pitch up
< Roll left
> Roll right
Special Orientation:
| Turn 180 deg
% Roll 180 deg
$ Roll until Horizontal
~ Turn/Pitch/Roll
t Pitch down
Structure:
[ Store current location
] Return to location
{ Start polygon shape
} End polygon shape
Increment / Decrement:
" Inc. length by 1.1
' Dec. length by 0.9
; Inc. angle by 1.1
: Dec. angle by 0.9
? Inc. thickness by 1.4
! Dec. thickness by 0.7
Additional:
c Increment color index
c(x) Set color index to x
|
| main | forward |