ALSOG

Another L-System Object Generator

ALSOG User Documentation

Table of Contents

1. Introduction
2. Lindenmayer Systems and ALSOG
2.1. Basic L-Systems
2.2. Parameterised L-Systems
2.3. Symbols in ALSOG
2.4. Context Sensitive L-Systems
2.5. Stochastic L-Systems
2.6. Other Extensions
3. ALSOG Data
4. ALSOG's Graphical User Interface
4.1. Overview
4.2. Viewer
4.3. Menu Bar
4.4. Tool Bar
4.5. Editor Tabs
A. Symbol Interpretation

1.Introduction

ALSOG, "Another Lindenmayer System Objects Generator", is a tool for editing and rendering of Lindenmayer Systems (or "L-Systems" for short). ALSOG

This document is the manual for ALSOG, version 1.0. It contains information that explains what ALSOG was designed for and how to use it. Further sources of information may be found on ALSOG's documentation pages.

ALSOG was tried to be designed to please its users. We hope for a feedback on this. Please give us a notice about your experience with ALSOG using the contact possibilities located at http://www.alsog.de/. We would also be very lucky to be informed about errors within the application or mistakes in the documentation.

This user documentation is structured as following: Chapter 2 gives an introduction into both, Lindenmayer Systems as well as how to use ALSOG to compute their numerous variants. Chapter 3 gives a coarse overview about the files ALSOG uses. Chapter 4 describes the interaction possibilities. The document closes with an appendix that shows known symbols.

2.Lindenmayer Systems and ALSOG

Lindenmayer Systems (or L-Systems for short) allow to model complex objects using simple rules. The name stems from the inventor of these systems, Aristid Lindenmayer. The major reference for information about Lindenmayer Systems is the book "The Algorithmic Beauty of Plants" (Przemyslaw Prusinkiewicz and Aristid Lindenmayer, 2002, ISBN 978-0387946764, Springer, Berlin). This book will be named “ABoP” in the following.

2.1.Basic L-Systems

Lindenmayer Systems perform a two-step approach to generate images or 3D objects from a given Lindenmayer System description.

In the first step, the "symbols" (or "words") within a given "axiom" are replaced using given replacement rules. A well-known, simple L-System is the Koch curve. The axiom (the initial term) is a single "F". This L-System has a single replacement rule only: F -> F+F--F+F. This rule says: replace each occurrence of "F" by "F+F--F+F".

Performed once on the given axiom "F", we will obtain "F+F--F+F". Done a second time again (in a second iteration step), every "F" in the result from the prior step "F+F--F+F" is again replaced by "F+F--F+F". The result is then "F+F--F+F+F+F--F+F--F+F--F+F+F+F--F+F".

Lindenmayer Systems allow to use rules that have more than one symbol in their premise. If more than one premise matches, the rules with the longest premise (the one with the most symbols) is selected.

After performing the wished number of replacement iterations, the obtained list of "symbols" or "words" (which are not spoken words) is translated into a graphical representation. In most cases, the symbol F (big F) is translated into "draw a line". The symbols '+' and '-' are used to rotate the direction. Using these three symbols, a large variety of graphical objects can be generated.

This kind of interpretation is known as "Turtle Graphics" – a virtual turtle rotates or draws lines (when looking at 2D graphics) while moving.

When being started, ALSOG shows the "Definition Tab" on its right side. Here, you can set the axiom ("F" in case of the Koch curve), and define rules consisting of a "Middle" and a "Conclusion". "Middle" defines what shall be replaced ("F" in the case of the Koch curve). "Conclusion" defines the replacement result (F-F++F-F in case of the Koch curve).

ALSOG allows to use multi-symbol premises and selects the one with the highest number of symbols in the case more than one of them matches.

The number of replacement iterations is given as a number in this tab’s entry named "Iterations:".

Warning

You should not try to set the iteration number to a high value at a very begin. Lindenmayer Systems tend to get very big and because ALSOG is designed to pose as few limits as possible, you may end up with an application breakdown resulting from insufficient memory. Additionally, the computation time may be very large.

The turtle rotates when interpreting the symbols '+' and '-' using the defaults given as "Default rotation values (x, y, z):" at the bottom of the same tab. The default length of the drawn symbol is defined on the "Shaping Tab".

2.2.Parameterised L-Systems

So far, the angles the turtle rotates around as well as the distance it moves (the length of interpreted symbols) was determined using global defaults. The so-called "Parameterised Lindenmayer Systems" extend symbols by a list of parameters. The parameters are a vector of floating point numbers or mathematical expressions (see below), divided by colons (','). They are listed in round brackets ('(' and ')') that have to be given directly after the symbol.

The first parameter is usually used when interpreting symbols as turtle actions. For rotating actions, e.g. '+' or '-', the parameter overwrites the rotation amount defaults. The following table lists some examples.

Table2.1.Examples of Parameter Interpretation

Parameterised SymbolInterpretation
+(40)rotate by 40
-(75)rotate by -75
F(10)move by ten units, draw
f(2)move by two units, don’t draw

The axiom only accepts values (given directly or as defined variables) as parameters. The premise usually contains variables as placeholders for parameters. They can be used during the computation of the conclusion. The conclusion itself accepts numerical functions as parameters that perform modifications on the parameter values’.

The modifications may use a large variety of built-in functions, namely: "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "log2", "log10", "log", "ln", "exp", "sqrt", "sign", "rint", "abs", "if", "sum", "avg", "min, "max".

In addition, constants can be defined at the "Processor Extensions Tab" tab within the table named "Constants and functions:".

2.3.Symbols in ALSOG

Several common and defined symbols are used by Lindenmayer Systems. In the following, we will distinguish between words (like 'F') and special symbols (like '+' or '-'). There are several commonly used special symbols, and ALSOG follows the conventions used in ABoP. The complete list of special symbols can be found in Appendix A and may as well be found in ALSOG’s GUI, when selecting the "Symbol Help Tab".

The following subchapters discuss some peculiarities of words in ALSOG and present the special symbols ALSOG knows.

2.3.1.Words/Symbols

Words in ALSOG consist of at least one alphabetic character (that may be both, lower case or upper case). Every word is per default interpreted as being "not interpreted" and "not visible" (this means the state of the turtle stays as it is, e.g. nothing is drawn). This may be changed for each word individually on ALSOG's "Shaping Tab". The symbol itself can be selected using the combo box named "Item:".

The "Shaping Tab" additionally allows to change the shape of the object, its default length as well as further representation options, depending on the selected shape.

ALSOG distinguishes between single-character words and multi-character words. Usually, single-character words are used. E.g., the axiom "FFFF" would be interpreted as four "F"s. But in some cases, one can find L-Systems that use multi-character words, such as "plant", “internode”, or “flower” instead of "F", see ABoP, p. 27. ALSOG allows both interpretations, but the user has to define it explicitly. ALSOG's "Definition Tab" includes a checkbox labelled "Using multi-char words". When checked, words of at least one character are interpreted as symbols and have to be divided using white spaces (" "). If not checked, every character is interpreted as a single symbol. They do not have to be divided using spaces. Both counts for the axiom as well as for the replacement rules.

2.3.2.Bracketed L-Systems

Bracketed L-Systems allow modelling of branching structures. When a '[' is interpreted, the complete state of the turtle stored on a stack – "kept in mind". When, after some other symbols, a ']' is interpreted, the state is restored. The turtle is again at the same position and has all other variables set to the values that were stored previously. ALSOG allows nested branches.

Both, '['and ']' should be included in the same rule. The behaviour is undefined, otherwise. Both, '[' and ']' do not expect parameters.

Table2.2.Special Symbols used for Bracketed L-Systems

SymbolBehaviour
[start a branch (push state to stack)
]complete a branch (pop state from stack)

2.3.3.Moving the Turtle in 3D

The turtle may turn, pitch, and roll to enable moving in three dimensions. Additionally, it may perform some other actions that change its direction.

Table2.3.Special Symbols used for changing the Turtle's Direction

SymbolBehaviour
+turn left (*)
-turn right (*)
^pitch up (*)
&pitch down (*)
\roll left (*)
/roll right (*)
|turn around (*)
$rotate to vertical (*)
#reverse directions

2.3.4.Colours and Polygons

Each word has a definition about its colour. Per default, each interpreted word is draw as a white line. This may be changed within the "Colouring Tab" tab. When using palettes, the symbols "'" and '"' increment and decrement the index (the position) of the colour to use within the palette.

Lindenmayer systems allow to draw polygons. A polygon begins when a '{' is interpreted. The turtle is recorded as long as a '}' occurs.

Table2.4.Special Symbols used for Drawing Polygons and Changing Colours

SymbolBehaviour
.record vertex (*)
{start a polygon
}close a polygon
'increment colour index (*) or by 1
"decrement colour index (*) or by 1

2.3.5.Parameters Changing Symbols

Some special characters change the defaults of other parameters.

Table2.5.Special Symbols used to change Default Parameters' Values

SymbolBehaviour
;multiply default rotation (*) or with 1.1
,divide default rotation (*) or by 1.1
?multiply default width (*)
!divide default width (*)
>multiply default length (*) or with 1.1
<divide default length (*) or by 1.1

2.4.Context Sensitive L-Systems

Up to now, the symbols that matched a premise were completely replaced by the conclusion. Context Sensitive Lindenmayer Systems extend the premise by two parts, located to the right and to the left of the initial premise. As the initial, "middle", premise, these parts have to match the respective part of the axiom, but are not replaced during term replacement.

ALSOG’s fields for adding a right and a left part of the premise are hidden per default and have to be enabled using "Rule Table Option" entry of the "View" menu, first. The according rows named "right" and "left" will be shown in the "Rules:" table. If an ALSOG Lindenmayer Definition is loaded that contains right and left parts of the premise, these rows are shown automatically.

2.5.Stochastic L-Systems

Stochastic Lindenmayer Systems allow to have more than one conclusion for the same premise. The conclusion to apply is selected by choosing one of the given randomly.

For using Stochastic L-Systems in ALSOG, one should enable the row "probability" of the rules list. This is done using "Rule Table Option" entry of the "View" menu. Every rule has to be completely given - including all parts of the premises (which all are same) as well as the conclusions. The probability must be given additionally.

Please note that the random number generator may be influenced by changing its ‘seed’. This is explained to a larger detail in Section 2.6.1.

2.6.Other Extensions

Some other extensions used and/or referenced in ABoP are discussed in the following.

2.6.1.Random Numbers

The sequence can be changed using the "Random seed:" entry located at the "Tweaks Tab".

2.6.2.Ignoring during Replacement

The approach by Hogeweg and Hesper to model plants uses, as discussed in ABoP, p. 33-35, a Lindenmayer System where the symbols '+' and '-' are ignored when matching premises against the axiom. ALSOG allows to set whether a symbol shall be ignored. This can be done in the table "Ignore on computation:" in the "Processor Extensions Tab" tab. Per default, no symbol is ignored.

2.6.3.Tropism

Tropism is currently under evaluation. It may be defined by giving the direction of the tropism vector and the strength. Both can be edited using accordingly named entries located at the "Tweaks Tab".

3.ALSOG Data

Native ALSOG files have the extension “.als”. Each .als-file contains the definition of a single Lindenmayer System, including all parameters that are accessible via the graphical user interface. ALSOG allows to open (read) and write .als files.

4.ALSOG's Graphical User Interface

4.1.Overview

The main window is divided into two sections, a viewer part and a tabbed editor part. Additionally, a menu bar and a tool bar exist that allow further interaction. The following image shows these parts, the usage of these four elements is described in the following.

Figure4.1.Main ALSOG window

Main <b>ALSOG</b> window

4.2.Viewer

After starting the application or if a document was closed (see "Close"), the viewer stays black. As soon as a document was loaded (see "Open") or the user has entered a new, valid definition of a Lindenmayer System, the resulting three dimensional turtle interpretation of this system appears within the viewer.

The viewer allows to rotate, zoom, and move the shown Lindenmayer system using the mouse. Direct interaction with the viewer using the mouse is performed by positioning the mouse within the viewer, pressing the left, the right, or both mouse buttons, and moving the mouse. The viewer behaves as following:

The view can be reset using the menu View->Center View.

Some additional actions can be triggered using the keyboard. These actions are:

4.3.Menu Bar

4.3.1.The "File" Menu

The File-Menu allows you to load, save, import, and export L-Systems. It also contains a list of previously loaded L-Systems.

4.3.2.The "Edit" Menu

Here, you can find items which allow you to undo or redo previous actions or revert the L-System to a definition as loaded last.

4.3.3.The "Settings" Menu

The "Settings" Menu allows you to change the application's behaviour.

4.3.4.The "View" Menu

Here, ALSOG's user interface can be adapted.

4.3.5.The "Help" Menu

Contains basic information about the application.

4.4.Tool Bar

The tool bar contains shortcuts to the following menu entries which also can be found within the menu bar and were described previously:

4.5.Editor Tabs

The entries for defining a Lindenmayer system and its appearance are divided among a set of "tabs". Each of these tabs groups parts of a definition that relate. As an example, the first tab allows to define the axiom and the rules, the third the shape of symbols, the fourth their colouring, and so on. Each tab and its contents are described in the following.

4.5.1.The "Definition Tab"

Here, one can define the basics of the L-System to render. These are:

4.5.2.The "Processor Extensions Tab"

More complex L-Systems require additional information. Within this tab, you can change the list of items to ignore on computation and define constants or functions.

4.5.3.The "Shaping Tab"

This tab allows you to define the shape the interpreter uses to instantiate a symbol.

4.5.4.The "Colouring Tab"

The colouring tab allows you to define the way a shape is coloured.

4.5.5.The "Tweaks Tab"

The "tweaks tab" holds additional possibilities to change the L-System behaviour or interpretation.

4.5.6.The "Environment Tab"

Within this tab, you can define the environment settings, including the colour of the background, and defining the lights used.

4.5.7.The "Statistics Tab"

This tab contains some information only. If an L-System was computed, you can find some information about it herein.

4.5.8.The "Symbol Help Tab"

This tab contains some information only. What you can find herein, is a table which contains symbols within the left column ("Symbol") together with a description about what they do within the according right column ("Meaning").

AppendixA.Symbol Interpretation

TableA.1.Symbols known to ALSOG and their Interpretation

SymbolDefault behaviour
Fmove turtle forward, drawing (*)
fmove turtle forward, don't draw (*)
Gmove turtle forward, draw, don't record vertex (*)
gmove turtle forward, don't draw, don't record vertex (*)
.record vertex (*)
+turn left (*)
-turn right (*)
^pitch up (*)
&pitch down (*)
\roll left (*)
/roll right (*)
|turn around (*)
$rotate to vertical (*)
#reverse directions
[start a branch (push state to stack)
]complete a branch (pop state from stack)
{start a polygon
}close a polygon
'increment colour index (*) or by 1
"decrement colour index (*) or by 1
;multiply default rotation (*) or with 1.1
,divide default rotation (*) or by 1.1
?multiply default width (*)
!divide default width (*)
>multiply default length (*) or with 1.1
<divide default length (*) or by 1.1

Your message
Name:
E-Mail:
Subject:
Message:

Supporting an e-mail address allows us to answer.

Your message has been sent. Thank you.