ALSOG User Documentation
Table of Contents
- 1. Introduction
- 2. Lindenmayer Systems and ALSOG
- 3. ALSOG Data
- 4. ALSOG's Graphical User Interface
- 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
supports stochastic, context sensitive, and/or parametric Lindenmayer Systems;
offers a variable interpretation of symbols, pre-set with standard values;
supports different 3D shapes: line, tube, cone, sphere, or torus;
supports different methods for colouring;
exports images to several formats, such as .png, .gif, .jpg, or .bmp;
exports 3D-objects to several formats, such as .obj, .flt, or .osg.
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 Symbol | Interpretation |
---|---|
+(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
Symbol | Behaviour |
---|---|
[ | 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
Symbol | Behaviour |
---|---|
+ | 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
Symbol | Behaviour |
---|---|
. | 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
Symbol | Behaviour |
---|---|
; | 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
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:
left mouse button and move: rotate
right mouse button and move: zoom
left and right mouse buttons and move: move
The view can be reset using the menu View->Center View.
Some additional actions can be triggered using the keyboard. These actions are:
s: triggers statistics
w: triggers wireframe/points/complete visualisation
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.
: a window opens which allows you to choose an ALSOG-file to load. After selecting the file and clicking “OK” or double-clicking the file within the window, the Lindenmayer System will be loaded and shown after being computed.
: If an L-System was loaded and modified you can save the changes by choosing this item. If the L-System was not saved before, a window will be shown where you can select the folder to save the L-System into and its name.
: Choosing this item will show a window where you can select the folder to save the L-System into and its name.
: If an L-System is defined, you can generate picture files using this entry. These contain a picture of the L-System as they are shown within the viewer, including the camera, lights, and other settings. Only the size can be changed.
When selected, a window will be shown where the size of the generated image can be defined. After pressing “Ok”, you can select the folder to save the picture into and its name.
: If an L-System is defined, you can generate 3D-object files using this entry. When selected, a window will be shown where you can select the folder to save the object into and its name.
: Choosing this item will show a window where you can select the folder to save the L-System into and its name.
: You may find the recently loaded / saved files within this list.
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.
: When selected, the defined L-System is re-computed at each change. In some cases, it may make sense to disable this behaviour to reduce the computation frequency. If disabled, you have to compute the L-System manually by pressing the “Compute” button.
4.3.4.The “View” Menu
Here, ALSOG's user interface can be adapted.
: All view changes — rotation of the object, its position within the screen, and the zoom are restored to their defaults.
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:
Open…
Save
Save As…
Export Image…
Export Object…
Compute
Undo
Redo
Center View
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:
: Here, you can type a name for the L-System. You can place any text herein.
: By enabling this checkbox, you let ALSOG know that your L-System is using multi-char words.
: Here, you can enter the number of iterations that shall be performed until the result is rendered. You can either enter a number directly into the text field or use the arrows to increase/decrease the iteration.
Warning
The value for iteration should be chosen very carefully as the computation time as well as the amount of needed memory increases very fast when the number of iterations is increased.
: You can enter the rules into this table. New rules are placed into the last free row. After inserting a new rule, a new row will be appended.
By default, only two columns are visible, one named “Middle” into which the string to replace should be placed, and one named “Conclusion” into which the replacement should be entered. You can let ALSOG show further tables using the menu View->Rule Table Options.
A line can be deleted by selecting the complete line and pressing the “delete” key.
: Here, you can enter the default turtle rotations around the three axes. You can either enter the values directly into the text fields, or use the arrows or the spinner to change the value.
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.
: The table lists all available symbols, including the default operator symbols and the words of the L-System you defined. Enabling the according checkbox in the right column of the table will force ALSOG to simply ignore the according symbol when a new rule is applied.
: This table allows you to define named values or functions which may be used within the L-System definition.
4.5.3.The “Shaping Tab”
This tab allows you to define the shape the interpreter uses to instantiate a symbol.
: the combo box named “Item” at the top of this tab allows you to choose one of the symbols that are used within your L-System. Additionally, the symbol ‘.’ is always accessible. It is not possible to define shapes for the operators.
All changes done within this tab will affect the interpretation of this symbol. As soon as you switch to another symbol, the tab will be filled with according settings.
: This checkbox defines whether the symbol will be interpreted. Not interpreted symbols have no effect on the turtle. Because of this, disabling this checkbox makes all other entries inaccessible (greys them out).
: Even if a symbol is interpreted, it still can be set to invisible. This allows modelling of spaces between geometrical objects.
: Herein, you can change the shape of the interpreted symbol. Each of the available shapes has further parameters which appear as soon as the shape is chosen. The table below describes these parameters.
Table4.1.Shape Parameter
Parameter Name Parameter Description Length The size of the shape along the turtle's direction Width The size of the shape orthogonal to the turtle's direction Begin Width (cones) Width at the begin position of the shape End Width (cones) Width at the end position of the shape Inner Width (tori) The width of the inner ring of the torus Outer Width (tori) The width of the outer ring of the torus All shapes but lines may be rendered in different qualities. Using lower qualities may yield in shapes that look dirty, but increases the speed they are drawn with.
Tip
Use a lower quality when starting to design an L-System. Increase the quality for final rendering.
Cones and tubes may also be “closed” a certain way. The following table describes available closures.
Table4.2.Cap closures
Closure Name Closure Description none Nothing is placed at the cones'/tubes' end. The cones/tubes stay opened. disc The cones/tubes are closed using a flat disc. ball The cones/tubes are closed using a ball.
4.5.4.The “Colouring Tab”
The colouring tab allows you to define the way a shape is coloured.
: The combo box named “Item” at the top of this tab allows you to choose one of the symbols that is used within your L-System. Additionally, the symbol ‘.’ is always accessible. It is not possible to define a colouring for the operators.
All changes done within this tab will affect the interpretation of this symbol. As soon as you switch to another symbol, the tab will be filled with according settings.
: This combobox allows you to choose from the available colouring schemes available in ALSOG. In the following, you will find a list of available colouring schemes together with their descriptions.
Single Colour
All instances of the chosen symbol are coloured using the same material definition. Choosing this colouring scheme allows you to define a single material only.
Index in Palette
The instances of the chosen symbol are coloured using materials from a palette. Which of the materials is used is determined by the operators “'” and ‘"’ which increase and decrease the colouring index, respectively.
The additional parameter “Offset” lets you define which position of the palette the first (not increased/decreased) colour index lies.
Random from Palette
The instances of the chosen symbol are coloured using materials from a palette. For each of the instances a random material from the palette is chosen. The additional parameters describe the range of the palette from which a random material shall be chosen. Please note that this choosing is affected by the value of the random number seed.
Iterate Palette Entries
The instances of the chosen symbol are coloured using materials from a palette. The additional parameters describe the range of the palette from which a random material shall be chosen. The index of the material used for a certain symbol is determined by this symbol's position within the L-System result. So, the materials are chosen in a way that the whole palette range is covered.
4.5.5.The “Tweaks Tab”
The “tweaks tab” holds additional possibilities to change the L-System behaviour or interpretation.
: The ”Tropism Strength“ and the ”Tropism Vector“ define how strong and into which direction the L-System interpreter shall pull the generated shapes to, respectively. A prominent application is the simulation of gravity.
: This entry is used for defining an initial value for the random number generator.
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.
: Here, you can change the colour of the background. It is black by default. If you double click on the black bar, a window will be shown which allows you to change the colour.
: ALSOG supports up to eight lights. You can select the light you want to change using the combo-box, where light#1 is selected by default. After selecting a light, you can change its following parameter:
Defines whether the light is switched on. Please remark that if no light is on, your L-System will stay dark or black.
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
Symbol | Default behaviour |
---|---|
F | move turtle forward, drawing (*) |
f | move turtle forward, don't draw (*) |
G | move turtle forward, draw, don't record vertex (*) |
g | move 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 |