Fractal Tree Generator

Images generated via the tool

This is a visual experiment in vector mathematics, geometry, recursive algorithms, and animation. I’ll try to post some of the background mathematics and geometry sometime.

What I find interesting is the diversity of shapes and patterns that result from playing around with just a few variables: number of and angle between branches,  the offset amount for skipping branch angles (“spiral factor”) and the recursion/fractal level. I included several presets to showcase some of the variety, but there are dozens or perhaps hundreds more very unique configurations.

Since this program runs fully in the browser, your computer has to do all the work to run it. It may seem like a simple program, but the calculations add up when the complexity gets too high. The complexity is proportional to the total number of nodes, which is equal to B^R, where B = # branches and R = recursion level. I put in a small aid visual to indicate when a high complexity might slow performance. Reduce B, R, or turn off the “fruits” to make the program run smoother. Generally, try to keep B^R less than 10,000.

So start by seeing what’s possible with the presets and then play around with the controls yourself. It should work on mobile, but is much easier to use on desktop. Also note that clicking out of the embedded view window pauses all animation. Feel free to right-click and save any interesting shapes you find, and share the settings in the comments below! I’m also open to any suggestions for usability improvements of the tool.

See the Pen Fractal Tree Generator by Andrew Herman (@hippiefuturist) on CodePen.