
Introduction 

LGrammar implements a two-dimensional and a three-dimensional graphics tool for
evaluating Lindenmayer grammars. These grammars are characterized by having no 
terminal symbols and by performing all possible symbol replacements in parallel
for each step. 

-------------------------------------------------------------------------------

Meaning of 2D Turtle Symbols 


       F forward with line drawing Turtle moves in direction of its orientation
	 vector (head) for a fixed distance and draws a line 
       f forward without line drawing Turtle moves in direction of its 
	orientation vector (head) for a fixed distance without drawing 
       + Turtle turns left by a specified angle 
       - Turtle turns right by a specified angle 
       [ start branching Push current turtle position and orientation on stack 
       ] terminate branching Pop data from stack replacing current turtle 
	position and orientation 
       | flip Turn turtle about 180 degree 
       ' Increment color index 
       ` Decrement color index 


------------------------------------------------------------------------------

Meaning of 3D Turtle Symbols 


       F forward with line drawing . Turtle moves in direction of its 
	orientation vector (head) for a fixed distance and draws a line. 
	Has no effect within a polygon '{ }' (see G) 
       f forward without line drawing . Turtle moves in direction of its 
	orientation vector (head) for a fixed distance
       without drawing New position is recorded as a corner point within 
	polygons '{ }'. 
       + Turn turtle about axis 'up' by a specified angle 
       - Turn turtle about axis 'up' by the negative of a specified angle 
       & Turn turtle about axis 'left' by a specified angle 
       ^ Turn turtle about axis 'left' by the negative of a specified angle 
       \ Turn turtle about axis 'head' by a specified angle 
       / Turn turtle about axis 'head' by a specified angle 
       | Turn turtle about axis 'up' by 180 degrees 
       [ start branching Push current turtle position and orientation on stack 
       ] terminate branching Pop data from stack replacing current turtle 
	position and orientation 
       { start polygon render a polygon, e.g. for a leaf 
       } terminate polygon 
       . Define a corner point within a polygon '{ }' 
       G Corresponds to F within a polygon '{ }' 
       ' Increment color index 
       ` Decrement color index 


------------------------------------------------------------------------------
 

Enter a New Grammar 

       first line: enter the axiom (a sequence of turtle symbols), terminated 
	by Return 
       further line: enter the production rules with the following form left 
	side "=" right side with 
              * left side equals one turtle symbol 
              * right side equals several turtle symbols 
       for example: 
       axiom: F-F-F-F 
       rule: F=F-F+F+F-F 

       Accept the new grammar by pressing the Init button. Press the Next 
       button to generate the next grammar derivative. With the Single button 
       you can derive only the next symbol. Pressing the Next button will
       complete this derivative. 

       Any characters may be used as grammar symbols. Characters which do NOT
       have a predefined graphics meaning (e.g. F does, but E does not) are 
       used for grammar derivation, but will not generate graphics themselves.
       Further on you can use indice to differ between differnt handlings, 
       for example F<a> will draw a line too. 

       The values for Length and Angle apply to all "F", "+", "-", and so on 
       in a grammar. In order to have different length or angle values for 
       individual symbols, these values may be specified after the symbol in 
       sharp brackets, e.g. 
              +<45> denotes turning left by 45 degrees, no matter what the 
		global value for Angle is 
              F<500> denotes drawing a line of length 500, no matter what the 
		global value for Length is 

-----------------------------------------------------------------------------

Choose Colors 


                                   

If you click the Color button in the applet threre'll appear a window with 2 color palettes. In the first one you can
choose between the 3 standard palettes 

      * Default - a rainbow colored palette 
      *  Green - mainly green and brown colors 
      *  Grey - grey colors 

by pressing the according button. 
The second palette is for creating your own color order. Click at any field in
the first palette and once again at any in
the second one to copy a color. To tell the system that it should draw with the
second palette, click the accept button.

The '#' symbol at the according label indicates the current color palette. 

-----------------------------------------------------------------------------

Stochastic Grammars 


Using individual values as probabilities for a rule after the equal sign 
results in defining stochastic grammers. Here, is it allowed to have several 
rules for the same symbol, however, the sum of all probability values for this
symbol has to be 1, e.g.: 

       F=<0.3> F+F 
       F=<0.7> F-F 


-----------------------------------------------------------------------------

Load and Save Files


If you press the "Load" or "Save" button, ther'll be a filebrowser, where you
can choose the file to save or store in.   

-----------------------------------------------------------------------------

Some Tips 

       Do not to terminate the input grammar with return. 
       To refresh the graphtal, click on the Refresh Button and the program 
	will draw the graphic once again. 


-----------------------------------------------------------------------------

Literature 


P. Prusinkiewicz, A. Lindenmayer: 
The SAlgorithmic Beauty of Plants 
Springer-Verlag, New York, 1990 

Chr. Drabek (in German) 
Implementierung von L-Grammatiken zur Erzeugung von Graftalen 
Diplomarbeit no. 986, Univ. Stuttgart, Fakultaet Informatik, 1993 