Categories
BLOG

weed fractals

Recursive Structures: Growing of Fractals and Plants

  • Heinz-Otto Peitgen
  • Hartmut Jürgens
  • Dietmar Saupe

Abstract

The historical constructions of fractals by Cantor, Sierpinski, von Koch, Peano, etc., have been labeled as ‘mathematical monsters’. Their purpose had been mainly to provide certain counterexamples, for example, showing that there are curves that go through all points in a square. Today a different point of view has emerged due to the ground-breaking achievements of Mandelbrot. Those strange creations from the turn of the century are anything but exceptional counterexamples; their features are in fact typical of nature. Consequently, fractals are becoming essential components in the modeling and simulation of nature. Certainly, there is a great difference between the basic fractals shown in this book and their counterparts in nature: mountains, rivers, trees, etc. Surely, the artificial fractal mountains produced today in computer graphics already look stunningly real. But on the other hand they still lack something we would certainly feel while actually camping in the real mountains. Maybe it is the (intentional) disregarding of all developmental processes in the fractal models which is one of the factors responsible for this shortcoming.

Keywords

The development of an organism may [. ] be considered as the execution of a ‘developmental program’ present in the fertilized egg. The cellularity of higher organisms and their common DNA components force us to consider developing organisms as dynamic collections of appropriately programmed finite automata. A central task of developmental biology is to discover the underlying algorithm from the course of development.

Aristid Lindenmayer and Grzegorz Rozenberg 1

Preview

Unable to display preview. Download preview PDF.

The historical constructions of fractals by Cantor, Sierpinski, von Koch, Peano, etc., have been labeled as ‘mathematical monsters’. Their purpose had been mainly to provide certain counterexamples,…

L-System User Notes

Introduction

This program implements some of the L-Systems discussed in “Lecture Notes in Biomathematics” by Przemyslaw Prusinkiewcz and James Hanan. A brief description of an 0L system will be presented here but for a more complete description the user should consult the literature.

The application was initially written to investigate methods of incorporating objects with a large number of drawing elements (lines, polygons) into a CAD package. L Systems is one way for example of “generating” trees at the rendering stage but not during the editing stage where the image complexity will slow down the response time.

Simple example of a 0L system

A string of characters (symbols) is rewritten on each iteration according to some replacement rules. Consider an initial string (axiom)

and a rewriting rule

After one iteration the following string would result

F+F-F-FF+F+F-F + F+F-F-FF+F+F-F + F+F-F-FF+F+F-F + F+F-F-FF+F+F-F

For the next iteration the same rule is applied but now to the string resulting from the last iteration

F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-FF+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-FF+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-FF+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-FF+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F+ F+ F-F-FF+ F+ F-F-F+ F-F-FF+ F+ F-F

Some symbols are now given a graphical meaning, for example, F means move forward drawing a line, + means turn right by some predefined angle (90 degrees in this case), – means turn left.

Using these symbols the initial string F+F+F+F is just a rectangle (ø = 90). The replacement rule F –> F+F-F-FF+F+F-F replaces each forward movement by the following figure

When drawing the graphical representation of the L string all other characters are ignored. The user may choose and use any other single printable characters for the replacement rules except, note: this excludes “white” characters such as spaces and tabs. For context sensitive L systems the * character is used to represent any match.

See the SYMBOL menu item for a summary of the reserved symbols. Menus

As with most applications the ABOUT menu item located in the Apple menu before the desk accessories displays information such as the version number and contact address of the developer.

This is the standard FILE menu although some of the items are not implemented.

NEW resets all the variables including the rules to their default values.

OPEN to load a rule description file previously saved or possibly created with a text editor.

SAVE and SAVE AS create rule description files.

PRINT and PAGESETUP control direct printing.

QUIT to exit from the program when finished.

The standard EDIT menu. The first 5 items are only included for compatibility reasons and do not apply to this application. (they are used with desk accessories in some cases)

The two special copy items allow images to be transferred to other applications depending on the preferred data type. Line drawings should be copied for CAD packages and bitmaps for painting programs.

Normally images will be scaled to fit the window, it is possible to zoom in or out of areas with the last two items.

This contains a number of predefined image specifications grouped together in categories given by the pop-up menu names.

Users are encouraged to submit further examples that can be added to this library.


This is the main menu for this application.

REDRAW updates the current display, for example, if the drawing was cancelled with clover-. (period)

Menu items 2 through 4 control the iteration depth. RESET sets it to 0, the number of iterations to compute may be incremented, decremented, or set to any particular number.

FRAME, FILL and BACKGROUND are pop-up menus that allow the colour of the lines, polygon fills and background to be set.

PRODUCTIONS allows the current rules to be altered. AXIOM menu item sets the initial string. STATE menu item varies environment variables. SYMBOL LIST displays the meaning given to various predefined and reserved symbols.

The type of system is selectable from the last 3 items.

Advanced features/comments

Always ensure that the ‘[‘ and ‘]’ brackets match in number, ie: there should always be the same number of each type. If not a stack overflow will quickly occur, a message displayed, and the iteration depth decremented. Note: non matching brackets are not tested before the string in interpreted, a problem only occurs when a stack overflow situation is encountered.

For a complete list of predefined symbol meanings look at the SYMBOL list under the ACTION menu.

Best quality hardcopy line drawing images can be obtained by using MacDraw or Claris CAD. In both cases copy the image as a line drawing, paste it into MacDraw say, set the lines to black and line width 0.1mm, then print on a LaserWriter. Note: the number of lines can quickly approach the thousands and even tens of thousands, don’t expect the printing to be fast.

Time consuming drawing may be cancelled by typing clover-. (period)

The maximum length of the strings generated is 300,000 symbols. Attempting to exceed this will give an error message and automatic decrementing of the iteration count.

The maximum stack depth is 100. This means that a bracketed string cannot have brackets nested more than 100 deep.

1 2 3 2 1 2 3 4 5 4 3 4 3 2 1 0 is nested 5 deep

If the maximum stack depth is exceeded an appropriate error message will be displayed and the iteration depth decremented until the stack no longer overflows.

When copying to the clipboard as lines make the drawing window as large as possible for maximum resolution.

Heinz-Otto and Deitmar Saupe. The Science of Fractal Images. Springer-Verlag

Przemyslaw Prusinkiewicz. Application of L-Systems to Computer Imagery. Lecture Notes in Computer Science #291, Pages 534-548

Przemyslaw Prusinkiewicz, James Hanan. Lecture Notes in Biomathematics #79

Prusinkiewicz, P. Graphical Applications of L-Systems. Proc. of Graphics Interface 1986 – Vision Interface, 1986, Pages 247-253.

Smith, A.R. Plants, Fractals, and Formal Languages. Computer Graphics, 18, 3, 1984, Pages 1-10

Prusinkiewicz, P and Lindenmayer A. The Algorithmic Beauty of Plants. Springer Verleg, 1990, Pages 40-50

L-System Leaf

L-System Bushes

axiom = Y
X -> X[-FFF][+FFF]FX
Y -> YFX[+Y][-Y]
angle = 25.7
axiom = F
F -> FF+[+F-F-F]-[-F+F+F]
angle = 22.5
axiom = F
F -> F[+FF][-FF]F[-F][+F]F
angle = 35

Attributed to Saupe

axiom = VZFFF
V -> [+++W][—W]YV
W -> +X[-W]Z
X -> -W[+X]Z
Y -> YZ
Z -> [-FFF][+FFF]F
angle = 20
axiom = FX
X -> >[-FX]+FX
angle = 40

L-System sticks

axiom = X
F -> FF
X -> F[+X]F[-X]+X
angle = 20

L-System algae

axiom = aF
a -> FFFFFv[+++h][—q]fb
b -> FFFFFv[+++h][—q]fc
c -> FFFFFv[+++fa]fd
d -> FFFFFv[+++h][—q]fe
e -> FFFFFv[+++h][—q]fg
g -> FFFFFv[—fa]fa
h -> ifFF
i -> fFFF[–m]j
j -> fFFF[–n]k
k -> fFFF[–o]l
l -> fFFF[–p]
m -> fFn
n -> fFo
o -> fFp
p -> fF
q -> rfF
r -> fFFF[++m]s
s -> fFFF[++n]t
t -> fFFF[++o]u
u -> fFFF[++p]
v -> Fv
angle = 12
axiom = aF
a -> FFFFFy[++++n][—-t]fb
b -> +FFFFFy[++++n][—-t]fc
c -> FFFFFy[++++n][—-t]fd
d -> -FFFFFy[++++n][—-t]fe
e -> FFFFFy[++++n][—-t]fg
g -> FFFFFy[+++fa]fh
h -> FFFFFy[++++n][—-t]fi
i -> +FFFFFy[++++n][—-t]fj
j -> FFFFFy[++++n][—-t]fk
k -> -FFFFFy[++++n][—-t]fl
l -> FFFFFy[++++n][—-t]fm
m -> FFFFFy[—fa]fa
n -> ofFFF
o -> fFFFp
p -> fFFF[-s]q
q -> fFFF[-s]r
r -> fFFF[-s]
s -> fFfF
t -> ufFFF
u -> fFFFv
v -> fFFF[+s]w
w -> fFFF[+s]x
x -> fFFF[+s]
y -> Fy
angle = 12

L-System Weed

axiom = F
F -> FF-[XY]+[XY]
X -> +FY
Y -> -FX
angle = 22.5

Triangle

axiom = F+F+F
F -> F-F+F
angle = 120

The IFS equations are as follows xn+1 = a xn + b yn + e

The parameter table:

Quadratic Gosper

axiom = -YF
X -> XFX-YF-YF+FX+FX-YF-YFFX+YF+FXFXYF-FX+YF+FXFX+YF-FXYF-YF-FX+FX+YFYF-
Y -> +FXFX-YF-YF+FX+FXYF+FX-YFYF-FX-YF+FXYFYF-FX-YFFX+FX+YF-YF-FX+FX+YFY
angle = 90

Square Sierpinski

axiom = F+XF+F+XF
X -> XF-F+F-XF+F+XF-F+F-X
angle = 90

Crystal

axiom = F+F+F+F
F -> FF+F++F+F
angle = 90

Derby, Western Australia

Peano Curve

axiom = X
X -> XFYFX+F+YFXFY-F-XFYFX
Y -> YFXFY-F-XFYFX+F+YFXFY
angle = 90

Quadratic Snowflake

axiom = F
F -> F-F+F+F-F
angle = 90

Variation by Hasan Hosam.
December 2018
axiom = FF+FF+FF+FF
F -> F+F-F-F+F
angle = 90

Quadratic Koch Island

axiom = F+F+F+F
F -> F+F-F-FFF+F+F-F
angle = 90
String length: 63

String length: 567

String length: 5103

String length: 45927

axiom = F+F+F+F
F -> F-FF+FF+F+F-F-FF+F+F-F-FF-FF+F
angle = 90

Variation by Hasan Hosam.
December 2018
axiom = X+X+X+X+X+X+X+X
X -> X+YF++YF-FX–FXFX-YF+X
Y -> -FX+YFYF++YF+FX–FX-YF
angle = 45

Koch Curve

axiom = F+F+F+F
F -> F+F-F-FF+F+F-F
angle = 90

Board

axiom = F+F+F+F
F -> FF+F+F+F+FF
angle = 90

Hilbert

axiom = X
X ->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YF+XF+YF-XF-YF-XF+YF+XF+YF+ XF-YF-XF

String length: 2186

String length: 6560

Von Koch Snowflake

axiom = F++F++F
F -> F-F++F-F
angle = 60

The IFS equations are as follows xn+1 = a xn + b yn + e

The parameter table:

Cross

axiom = F+F+F+F
F -> F+FF++F+F
angle = 90

Cross

axiom = F+F+F+F
F -> F+F-F+F+F
angle = 90

Pentaplexity

axiom = F++F++F++F++F
F -> F++F++F|F-F++F
angle = 36

Tiles

axiom = F+F+F+F
F -> FF+F-F+F+FF
angle = 90

Rings

axiom = F+F+F+F
F -> FF+F+F+F+F+F-F
angle = 90

Dragon Curve

axiom = FX
X -> X+YF+
Y -> -FX-Y
angle = 90

Hexagonal Gosper

axiom = XF
X -> X+YF++YF-FX–FXFX-YF+
Y -> -FX+YFYF++YF+FX–FX-Y
angle = 60

Lévy curve

axiom = F
F -> -F++F-
angle = 45

Classic Sierpinski Curve

axiom = F–XF–F–XF
X -> XF+F+XF–F–XF+F+X
angle = 45

Krishna Anklets

axiom = -X–X
X -> XFX–XFX
angle = 45

Mango Leaf

Snake Kolam

Kolam

axiom = (-D–D)
A -> F++FFFF–F–FFFF++F++FFFF–F
B -> F–FFFF++F++FFFF–F–FFFF++F
C -> BFA–BFA
D -> CFC–CFC
angle = 45

Kolams from India

Kolam patterns from the South of India, drawn by rice powder in front of houses every morning before the doorway is used.

L-System User Notes Introduction This program implements some of the L-Systems discussed in “Lecture Notes in Biomathematics” by Przemyslaw Prusinkiewcz and James Hanan. A brief description