The following appendix was taken from Extentions to the graphical interpretation of L-Systems based on turtle geometry by R. Mech and P. Prusinkiewicz.

Interpreted Symbols

Turtle rotations

The turtle can be rotated only around its heading, left, or, up vector (see Figure 2.1):

+(THETA)
Turn left by angle (THETA) degrees around the U axis.

-(THETA)
Turn right by angle (THETA) degrees around the U axis.

&(THETA)
Pitch down by angle (THETA) degrees around the L axis.

^(THETA)
Pitch up by angle (THETA) degrees around the L axis.

\(THETA)
Roll left by angle (THETA) degrees around the H axis.

/(THETA)
Roll right by angle (THETA) degrees around the H axis.

|
Turn around 180 degrees around the U axis. This is equivalent to +(180) or -(180). It does not roll or pitch the turtle.

@v
Roll the turtle around the H axis so that the H and U lie in a common vertical plane with U closest to top.

If no parameter is given for the symbols +, -, &, ^, \, and /, the value of the global parameter angle increment is used.

Changing turtle parameters

The following symbols change turtle parameters:

;(n,n2)
Increase the value of the current color index or material index by the color increment, or set to n if a parameter is given. If two-sided materials are used - the initial color index in the view file has two parameters (only in material mode) - both indexes of the front and back material are increased or set to n. If an optional second parameter is present, the index of the back material is set to n2.

,(n,n2)
Decrease the value of the current value index or material by the color increment, or set to n if a parameter is given. In case of two-sided materials, the function is the same as for module ;.

#(n)
Increase the value of the current line width by the global parameter line width increment, or set to n if a parameter is given.

!(n)
Decrease the value of the current line width by the global parameter line width increment, or set to n if a parameter is given.

@Tx(index)
Sets texture with index index (the order of the texture specification in the view file). The texture is not applied to surfaces; a surface must be associated with a texture when it is defined. Index 0 switches off texturing.

Changing position and drawing

F(d)
Move forward a step of length d and draw a line segment from the original position to the new position of the turtle. If the polygon flag is on (see the symbols { and }), the final position is recorded as a vertex of the current polygon. If no parameter is given, the default step size 1 is used.

f(d)
Move forward a step of length d without drawing a line. If the polygon flag is on, the final position is recorded as a vertex of the current polygon. If no parameter is given, the default step size 1 is used.

G(d)
Move forward a step of length d and draw a line. If no parameter is given, the default step 1 is used.

g(d)
Move forward a step of length d without drawing a line. If no parameter is given, the default step size 1 is used.

@o(d)
Draw a circle of diameter d in the plane of the screen. If no parameter is given, the current line width will be used.

@c(d)
Draw a circle of diameter d in the HL plane. If no parameter is given, the current line width will be used.

@O(d)
Draw a sphere of diameter d. If no parameter is given, the current line width will be used. The spheres produced can be shaded even in the colormap mode, since a set of polygons approximating a sphere is generated using code from the widely available sphere.c file by Jon Leech (leech@cs.unc.edu).

The global parameter line style specifies whether the line is drawn as a line, polygon, or a cylinder.

Modeling of structures with branches

[
Push the current state of the turtle (all its parameters) onto a pushdown stack.
]
Pop a state from the stack and make it the current state of the turtle.

%
The symbol % cuts the remainder of a branch. Whenever it is detected in the string during the generation process, it and all following symbols up to the closest unmatched right bracket ] are ignored for derivation purposes, and will therefore disappear from the generated string. If an unmatched right bracket is not found, symbols are ignored until the end of the string.

Symbols used to create polygons along with F and f

{
Start a new polygon by pushing the current turtle position onto the polygon stack and set the polygon flag on.

}
Pop a polygon from the stack and render it. If no more polygons are on the stack, turn the polygon flag off.

.
Place the current state of the turtle on the polygon stack if the polygon flag is on.

Drawing parametric bicubic surfaces

~
Draw the predefined surface identified by the symbol immediately following the ~ at the turtle's current location and orientation. The control points, geometry and neighborhood information for surfaces are read from surface specification files at the beginning of the simulation.

@PS(i,basis)
Intializes the four rows and columns of control points for an L-system defied suface i to (0,0,0). The optional parameter basis specifies the type of patch as:
  1. Bezier
  2. B-spline
  3. Cardinal spline
If no basis is given, the default, Bezier, is used.

@PC(i,r,c)
Assigns the current position of the turtle to the control point of the L-system defined surface i in row r and column c.

@PD(i,s,t)
Draws the surface defined by the control points of surface i using s lines along the rows and t lines along the columns.

Drawing generalized cylinders

@Gs
Start a generalized cylinder in the current turtle position.

@Gc(strips)
Specifies a control point on the central line of the generalized cylinder. The value of strips specifies how many mesh strips are drawn between the control point and the previous one. The more strips are drawn the smoother the generalized cylinder looks. If no parameter is given, one strip is drawn.

@Ge(rings)
End a generalized cylinder. The parameter rings controls the number of strips as for symbol @Gc.

@Gr(angle1,length1,angle1,length2)
Specifies the slope and length of two tangents of a Hermite curve defining the radius change as a longitudinal section between two consecutive control points of a generalized cylinder axis. As a default, the radii at the two control points are linearly interpolated along a segment.

@Gr(flag)
Switches on (flag=1) or off flag=0) an automatic adjustment of tangents of a longitudinal section for segments of non-unit length. The longitudinal section is always defined for a segment of a unit length and then stretched onto the segment of a non-unit length. As a default, tangents are not adjusted after the stretching (see Section 3.2.2 for more details).

@#(contour_id)
Sets a different contour for the generalized cylinder. Contours are specified in the view file. A contour with id 0 is the default cicle.

Changing tropisms parameters

@Ts(index,value)
Set elasticity parameter of tropism with index index to value. Index is given by the order of the tropism specification in the view file (starting with 1).

@Td(index[,value])
Decrease the elasticity parameter by the default elasticity increment specified in the view file or by the given value value.

@Ti(index[,value])
Increase the elasticity parameter by the default elasticity increment specified in the view file or by the given value value.

@Tp
Prevent twist. This command adjusts the turtle's up and left vector to minimize the twist (see Section 3.3).

@Tf
Force the twist. Since tropisms automatically force twist prevention, the effect of symbols / or \ can be nullified. It is necessary then to add the symbol @Tf to force the twist.

Symbols of Sub-L-systems

?(id,scale)
Causes the generator to save a reference to the current L-system on a stack and to use the list of productions from the sub-L-system identified by id during subsequent production matching and application. During interpretation, the current scale is saved on a stack and the structure resulting from interpretation of the generated substring is scaled by scale.

$
end the sub-L-system and return to the previous set of productions and scale.

Miscelaneous commands

@L("Label")
Prints the "label" in the drawing window at the current turtle location using the font specified in the view file.

@S("any system call")
Will make the system call when interpreted.


Preface
Parameters
Appendix I
Appendix II
References
Index Circles and Spheres Generalized Cylinders Surfaces Textures