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

  1. Place attractors
  2. Associate the attractors with nearby nodes (within some attraction radius/field of influence). For now only take the NEAREST node
  3. Iterate through the nodes and grow the network (segment length)
    1. If two nodes would collide we do not add the new node (collision radius)
  4. Kill the attractors (kill radius)
  5. 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

static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.05.54 1.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.08.58 1.png

Attractors placed along circles

Attractors are placed along circles with a few starting nodes. Starting with 1 circle then adding more

static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.17.20.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.19.19.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.19.06.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.19.36.png

Adding Rectangles, lines and randomizing the center locations

| static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.26.19.png | static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.26.29.png | | ——————————————————————————————————————————————— | ——————————————————————————————————————————————— |

Associating each seed node with a color

static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.31.04.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.31.15.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.32.09.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.32.49.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.33.53.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.34.08.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.34.40.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.35.02.png

More color palettes

static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.48.59.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-00.54.41.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-08.37.11.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-08.37.45.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-08.43.50.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.05.19.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.09.41.png!static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.14.11.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.25.19.png

Some different drawing styles

Bringing the segment lengths closer together

static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.28.37.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.28.55.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.31.29.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.34.12.png
static/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.46.51.pngstatic/sketches/G01_SpaceColonization/sketch.G01_SpaceColonization-2021-08-07-09.27.01 1.png

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