Detailing

Logo

Adding complexity to polygons.

View the Project on GitHub MichaelMBradley/Detailing

10 May 2021

Java

by Michael Bradley

Today I mostly finished my move to Java and significantly improved my code. The combination of Java running faster and me being forced to rethink my code as I rewrote it has improved speed several dozen times over.

Moving to Java also allowed me to implement a library that calculates the Delaunay Triangulation of a set of points for me. In short, the Delaunay Triangulation of a set of points is the triangulation such that the circumcircle of each triangle contains no other points in the set.

An example triangulation can be seen below.

A Delaunay Triangulation of a set of points.

Here, I’ve overlayed every circumcircle over the shape.

A Delaunay Triangulation of a set of points, with a series of circumcircles over it..

The Delaunay Triangulation can be easily applied to a circle packing of the shape.

A Delaunay Triangulation of a circle packing of a shape.

The following image contains the circumcircle for each triangle and is quite messy, but it provides me with a lot of oppurtunity.

A Delaunay Triangulation of a set of a circle packing of a shape, with the circumcircle of each triangle overlayed on top.

While this image is very busy, most of the circle will remain unused in a final version of this method. What I can now do is navigate around the shape (using the triangulation, the touching circles, or some other method), and between each node I can simply draw an arc following the circumcircle.

I’ve drawn a rough sketch of what that could look like below.

A Delaunay Triangulation of a set of points.

In reality, the vastly increased number of circles would result in a curve that more closely followed the polyline, not just individual circles.

tags: