Detailing

Logo

Adding complexity to polygons.

View the Project on GitHub MichaelMBradley/Detailing

12 May 2021

Kruskal

by Michael Bradley

As an experiment, I wrote an algorithm that uses the Delaunay triangulation to move around the shape. It simply selects a start point, then moves to whichever node it shares a corner with that has the minimum angle with the next vertex it’s trying to reach. There is also a check to ensure that it doesn’t double back on itself.

A path roughly follows the edges of a polyline.

To simplify matters, after generating a triangulation of the vertices I added a requirement that no edge could be too large, which got rid of may unnecessary edges.

Many small circles are linked by lines.

To add even more available circles, I added a variable which when increased worked to decrease the possible sizes of circles. This resulted in tighter, smaller packing.

Many small circles surround a polyline.

However, for general testing I will leave the circles large as generating tighter packings require much more time.

I was also able to implement Kruskal’s algorithm to find a minimum spanning tree of the circles generated.

A tree connects many circles around a polygon.

By adding a requirement that no two graphs may be connected if the size of the existing graph is greater than an integer N, I was easily able to split it up into smaller trees.

Many small trees connect circles around a polygon.

If you look closely, some of these graphs are not actually trees. It’s unclear why this is, but I have some theories I will investigate tomorrow.

As well, I have made good progress on an algorithm that can number these trees so that they may be selected in order to be traversed, but I was unable to finish it today.

tags: