Adding complexity to polygons.
For my first-year internship at Carleton University I’m working on a piece of code that will add complexity to a given polygon.
In this blog I keep track of what I’ve tried, what’s worked, and what hasn’t.
21 Jul 2021
I’ve created parameters corresponding to node size (higher = smaller nodes) and node depth (higher = nodes further from polyline).
20 Jul 2021
The last few weeks have been fairly devoid of massive new additions as I’ve been attempting to bugfix my code.
09 Jul 2021
I haven’t made a post yet this week as I’ve been hoping to present a working program, but unfortunately I haven’t yet been able to remove all the bugs.
30 Jun 2021
I’ve recently made some more progress on smoothing the exteriors of groups of nodes. My goal is to have the curve follow the nodes fairly roughly and minimise the length of curve touching a node. I want to create fairly blobby shapes, but I still want them to have detail.
25 Jun 2021
I decided to swap my IDE from the default Processing IDE to IntelliJ IDEA. While the Processing IDE worked fine for the most part, what I like about IntelliJ is:
21 Jun 2021
After a break, I made some good progress today.
01 Jun 2021
One recent method I’ve tried, slightly adapting a suggestion by Dr. Mould, is to determine which nodes intersect the polyline, and then group the remaining nodes based on which node intersecting the polyline they are closest to. I can then create a minimum spanning tree for each of these groups.
27 May 2021
Continuing on from yesterday, I spent more time today trying to come up with a better way to traverse the trees I had created. The problem comes from the fact that I want to visit as many trees as possible, but the more trees I visit the more likely I am to have a line connecting two trees passing straight through a third. While ensuring that no lines cross is still a while away, I want to avoid it as much as possible.
26 May 2021
In the past two days since the long weekend, I’ve been spending most of my time having marginal success with fixing the remaining bugs in the code that I showed off (in a bug free manner) in my last post. While I have made some improvement, it’s not yet fixed.
20 May 2021
Over the past few days I’ve been attempting to create code to smooth a line around the perimeter of the circles on my trees by creating a new circle that touches two adjacent circles.
17 May 2021
I began by fixing the bug in my traversal code from yesterday. When selecting a branch to traverse first, I assign a heading to each branch based on its real heading from the current position, and then sort by clockwise or counter-clockwise. Each heading is in radians, so I can simply sort the floats.
13 May 2021
I started out by fixing the issue I had previously where my limited spanning trees were sometimes not trees. The problem was that my artificial restriction on size sometimes resulted in one tree thinking it had combined with another, but the other did not combine with it. In any case, I fixed it.
12 May 2021
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.
10 May 2021
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.
07 May 2021
Yesterday I wrote code to find the closest circle at a series of points along the perimeter of the polygon. While this could be used to determine which circle a curve approximating the polyline should be based on locally, I don’t think that I will actually use this. Instead, I will likely choose which circle to focus on based on a graph or tree. In any case, the code could be useful at a later date.
05 May 2021
Now that I had some basic circle creation working (circle packing is a bit loose of a term for what I’ve actually implemented), I could start creating a graph.
04 May 2021
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.
03 May 2021
For the first day, I was mostly focused on setup.