On Generative Algorithms

Hyphae Github

I started playing with a system where I grew connected circles that were not allowed to overlap. The way it works is that you place a seed node (circle) somewhere, and give it a radius and a direction of travel. Then you attempt to append a new node to the perimeter of the first node in the travel direction. The important part is that you need the travel direction to "wobble" a little, so you perturbe the angle randomly each time. You also make sure the radius of new nodes grows a little smaller each time you append a new node.

hyphae ani

To get branches you can pick nodes at random and attempt to grow a new node more or less perpendicular to the branche's direction of travel. Either it collides, or you get a new branch. For interesting effects you can make the angle perturbations proportional to the width (radius) of the branch. Thicker branches are generally straighter than thin branches. And you can obviously do a lot of other things as well. For instance you get radically different results if you adjust how much more "flexible" branches grow as they grow thinner.

hyphae ani 2

Another little note is that when a branch branches off from an existing branch you should make the radius considerably thinner than the parent branch. You can see this happening all the time in trees. The idea is that there should be about as much mass before and after a branch intersection. (I read this somewhere, but I can't find the paper it was in.)