loading...
running...
The science
The space colonisation algorithm (Runions, Lane and Prusinkiewicz, 2007) grows a branching structure by letting a cloud of attractors (sites that want to be supplied: leaf buds, auxin sources, or in a vein pattern the cells that need blood) compete for the nearest branch tip. It needs no recursion and no L-system rules; the crown shape comes from where the attractors are.
One iteration. (1) For each attractor a, find the nearest tree node v within the influence distance di; if a node is already closer than the kill distance dk the attractor is removed (it has been reached and becomes a leaf). (2) For every node v that was chosen by at least one attractor, average the unit vectors pointing to them:
nv = (1/|Sv|) Σa∈Sv (a − v) / |a − v| d = (nv + g ey + noise) / |…| v' = v + D d
(3) A new node v' is added at distance D along that direction (g is a tropism term: positive grows upward, negative droops). Growth ends when no attractor is within reach of any node. Because each attractor only pulls its single nearest node, branches split naturally where attractors lie on different sides, and shaded interior regions stop growing once their attractors are killed.
Branch thickness: the pipe model. Leonardo da Vinci noted that the total cross-section of a tree's branches stays constant after each fork; the modern form is the pipe model with a general exponent n, applied from the twigs down to the root:
rparentn = Σ rchildn (n = 2: cross-section area is conserved; n = 3: Murray's law for minimum transport cost)
Every twig tip has the same radius r0, so the root radius satisfies rrootn = (number of twigs) × r0n; the readout and the checks verify this exactly. For a symmetric fork the child radius is rparent 2−1/n: 0.707 for n = 2 and 0.794 for n = 3 (the last graph). Real trees lie between about n = 2 and n = 2.5 for water conduction and mechanical support.
Cost. A spatial hash grid with cell size di makes the nearest-node search local, so one iteration costs roughly the number of live attractors times a few nodes instead of all nodes. The page checks that grid against a brute-force search.
Honest simplifications. Growth is purely geometric: there is no light, water, gravity on the wood, secondary thickening over years or leaf shading; the tropism term is a hand-set bias, not a hormone model; leaves are placed at killed attractors; branch length per step is constant. It is a morphology generator that reproduces the look and the fork statistics of real trees, not a model of tree physiology. The 3D page uses an identical engine, so the only difference between the pages is the extra dimension.