L system
Sample Scripts II


return to main index



Introduction

This page presents 6 examples of branching structures that resemble bushes or trees. They are provided here so that you can base your own experiments on 'known' shapes. The notes for this page were derived from page 15 of "The Algorithmic Beauty of Plants" by Przemyslaw Prusinkiewicz and Aristid Lindenmayer.

The token "{" pushes the transformation stack. In effect the token marks the beginning of a branch. The "}" token pops the transformation stack, it indicates that subsequent shapes should be added to the node immediately before the "push" - this effectively 'terminates' the branch. For example, the script,

    "1" "1{>z1}1{<z1}{1}"

says, for each "1", replace it with

  • 1   an upright segment,
  • {>z1}   a branch to the right,
  • 1   an upright segment,
  • {<z1}   a branch to the left, and finally,
  • {1}   an upright branch.

As this rule is repeatedly applied, the branching structure becomes increasingly complex.


image image image image


Branching


image

  axiom "1"
  generations 4
  rule 1 "1{>z1}1{<z1}1"
  angle 17
  scale 0.9

image

  axiom "1"
  generations 4
  rule 1 "1{>z1}1{<z1}{1}"
  angle 17
  scale 0.9

image

  axiom "1"
  generations 4
  rule 1 "11<z{<z1>z1>z1}>z{>z1<z1<z1}"
  angle 17
  scale 0.9

image

  axiom "G"
  generations 5
  rule G "1{>zG}1{>zG}<zG" 
  rule 1 "11"  
  angle 17
  scale 0.9

image

  axiom "G"
  generations 5
  rule G "1{>zG}{<zG}1G" 
  rule 1 "11" 
  angle 17
  scale 0.9

image

  axiom "G"
  generations 5
  rule G "1<z{{G}>zG}>z1{>z1G}<zG"
  rule 1 "11"
  angle 17
  scale 0.9



© 2002- Malcolm Kesson. All rights reserved.