L-systems generate weevils, pizza toppings, and matriarchal lineages(blog.plover.com) |
L-systems generate weevils, pizza toppings, and matriarchal lineages(blog.plover.com) |
As a fascinating coincidence, it was specifically thanks to Mark Dominus that I was fiddling with L-systems on Monday, even though I was not yet aware of this article. I wanted plant models that were a little more stochastic and expressive than bare L-systems, but less verbose and clunky than the CGA shape grammars used in CityEngine. Claude suggested parameterizing Chris Coyne's "context-free design grammars", giving very pleasing results like
# A monopodial tree: every node puts out one lateral and the axis carries
# on at `ratio` scale, so the laterals shrink, and crowd together, in the
# same geometric progression toward the tip.
param ratio = 0.9 in 0.7..0.97
param lateral = 0.5 in 0.2..0.8
param spread = 50 in 0..90
param divergence = 137.5 in 0..180
param droop = 6 in -20..30
start shoot
shoot when size < 0.03: leaf 6 3
shoot:
limb 1 0.09
shoot roll divergence tilt 0±5 scale ratio
shoot tilt spread±10 bend droop scale lateral
Further examples and 3-D rendering at http://canonical.org/~kragen/sw/plants.