A two dimensional tree algorithm

A trunk algorithm

  • The trunk needs to support and connect an arbitrary number of branches and roots.
  • Draw a vertical but not entirely straight line shape. The width of the shape is directly depending on the number of branches it needs to support.
  • The bottom part of the trunk is thrice as wide as the top part of the trunk.

A branch algorithm

  • A branch wants to extend into empty space (maximize entropy).
  • Draw a semi-horizontal line shape pointing up, sometimes straight and sometimes not so straight. One end of the shape is attached to either a trunk or another branch.
  • The part of the branch shape that is attached, is approximately twice the size of the part extending into empty space but never wider than the trunk or branch that it is attached to.

A leaf algorithm

  • A leaf is attached to a branch.
  • Draw a randomly shaped flat object that is about half a quarter of the size of the attached branch with one side turned up and one side turned down.
  • Connect the leaf to the branch with a short line shape, approximately half a quarter of the size of the leaf.

The root algorithm

  • A root is similar to a branch in wanting to extend into empty space (empty space is where no part of the tree algorithm is already constructed).
  • Draw a more or less squiggly line attached to the bottom of the trunk pointing downwards.
  • The part of the root that is attached to the trunk (or other root), is about three times as wide as the part of the root that is extending into empty space but never wider than the trunk or root it is attached to.