G01_SpaceColonization
G01_SpaceColonization
Using OpenRNDR to make a Space Colonization Algorithms to make some leaf like, tree like and maybe even different types of natural shapes and formation. Using Jason Webb’s and the following papers (1, 2) as a baseline. This involves having a bunch of nodes, these are the points that have already grown, and attractors (places which the nodes are growing towards). Each attractor then has a field of influence, for each of those nodes we calculate the average direction acting on the node. Draw the next segment, place our new nodes, and then finally kill off the attractors if a node get’s to close to it (and repeat).
The Algorithm
- Place attractors
- Associate the attractors with nearby nodes (within some attraction radius/field of influence). For now only take the NEAREST node
- Iterate through the nodes and grow the network (segment length)
- If two nodes would collide we do not add the new node (collision radius)
- Kill the attractors (kill radius)
- Prune any lone nodes (nodes which never became associated with an attractor) after a few counts
To do this we build a Spatial Index using a QuadTree. Luckily there was one already built in the OpenRNDR Extension Library, however it was not in the version of OpenRNDR I was building against, so I just copied it in to my util
directory for use in this algorithm. The QuadTree gets built at the beginning of every iteration. When doing the searches for the
Each source node will inherit it’s color from it’s parent node (in this iteration of the algorithm)
For this iteration we will just draw a circle for every node.
Progression
Using the QuadTree and Getting the Initial Algorithm Right
Random attractors with one seed node at the center
Attractors placed along circles
Attractors are placed along circles with a few starting nodes. Starting with 1 circle then adding more
Adding Rectangles, lines and randomizing the center locations
| | | | ——————————————————————————————————————————————— | ——————————————————————————————————————————————— |
Associating each seed node with a color
More color palettes
!static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.14.11.png |
Some different drawing styles
Bringing the segment lengths closer together
I made some improvements to the draw speed by using groupBy to group the nodes by their color and draw all of those nodes together. It still has issues drawing fast, but that seems to be due to some inefficiency in how the QuadTree look-ups are working.
Glossary
segment length attraction radius collision radius kill radius attractor node seed node
Future Work
- Refactor so that we used a doubly linked list so we can determine the number of children or who the parent is. G02_SpaceColonization_NodeSizeBasedOnChildCount
- Opacity and thickness effects based on node size G02_SpaceColonization_NodeSizeBasedOnChildCount
- Batch the circle drawing by color introduced in G01_SpaceColonization
- Draw paths not dots
- gradient based on attractor color and node color.
- Add boundaries, and obstacles
- Define the terms in the #Glossary