Detailing

Logo

Adding complexity to polygons.

View the Project on GitHub MichaelMBradley/Detailing

4 May 2021

Packing

by Michael Bradley

Now that I had some structure, I could get to work. I began by trying to affix some circles to other edges of my basic square shape.

A basic beginning of an attempt at circle packing the edges with an indiviual circle on each edge.

I was able to make quick progress towards covering the edges with circles of a uniform size.

A basic attempt at circle packing the edges with many circles on each edge.

Unfortunately, as I tried rotating the shape I realised that my code still had issues.

A rotating square has circles moving around vaguely near its edges, but not accurately.

While this type of packing could still yield results, there was another method that I wanted to try as well.

I experimented with packing just a square full of circles, each assigned randomly.

A square window filled with non-overlapping circles.

While this method generally leaves gaps between the circles, I simply calculated the distance from the circle to it’s closest neighbour and increased its radius accordingly, giving the above image.

Next, I overlayed a shape I had onto the random packing and wrote code to remove any circles that were not near one of its edges, leaving me with the following:

A strange polygon with many circles of varying sizes overlapping its edges.

I believe this is a promising avenue, and tomorrow I will look towards inducing a graph between the remaining circles. I will do this by either altering existing circles or creating new ones to fill in any remaining gaps between adjacent groups.

tags: