L-Systems by Sara Zan
L-Systems are described very well on Paul Bourke's website.

The following is the list of available sections:

  • axiom: initial state of the system
  • rules: list of rewrite rules that are applied on each iteration
  • depth: how deep we are allowed to go recursively
  • angle: if specified, this argument governs rotation angle. Can be overridden with actions
  • actions: list of graphic commands that are triggered by a matching character in the evolved system. The following is the list of available actions:
    • draw(x) draw x units in current direction
    • move(x) move x units in current direction without drawing
    • rotate(deg) rotate current direction deg degrees around Z axis
    • rotateX(deg) rotate current direction deg degrees around X axis
    • rotateY(deg) rotate current direction deg degrees around Y axis
    • push() saves current render state onto stack
    • pop() restores previously saved render state
    • setColor(color) set the current color value, '#ffa500' or 'orange'.
    • swapAngle() swaps the meaning of `+` and `-`.

    By default the following actions are added automatically:

    actions:
      F => draw(10)
      f => move(10)
      + => rotate(60)
      - => rotate(-60)
      & => swapAngle()
      [ => push()
      ] => pop()
    
  • width: width in pixels of the drawn line
  • color: color of the line. Accepts names and hex. E.g. blue, works the same as #0000ff
  • stepsPerFrame: how many steps we are allowed to render per single frame. If set to -1 the scene is rendered immediately. This could be dangerous on deep systems, as the entire system traversal may exhaust the browser's resources.
  • direction: three numbers separated by coma x, y, z that set initial direction
  • position: three numbers separated by coma x, y, z that set initial position
?
2px
0°
Pick from Examples Random Values Stop Generation Save as SVG
Examples