space-colonization

unstable

alt text

Algorithm for tree-like and bush-like objects. Based on this paper.

Usage

$ npm i -S space-colonization

iterate = space-colonization(opts)

Options:

These numbers (except the angles) assume the buds and hormones have a distance between them in the same range (e.g. from 0 to 5). If you provide positions that have a range of 10-50 for example nothing will grow because the viewDistance is too small for the initial bud to see anything!

When you call the above function you get back an iterate function. This function can be called every frame to grow the tree until all hormones are dead or all buds die before they eat all possible hormones. The result of each call is an object with two properties:

More info and examples will be coming soon. Post an issue if anything is unclear. See example.js for basic usage with regl.

License

MIT