Cut Locus

Note: the code below is a bit buggy and a work in progress!

Click on the canvas below to draw a point. Press \(\,\)c \(\,\)on your keyboard to close the the polygon when finished and click again to spawn a circle. A red circle is maximal and a blue (low alpha) is not. Press \(\,\)g \(\,\) to start mass random sampling within the polygon and press it again to stop. Press \(\,\)l \(\,\) to see the cut locus generated by the red circles. Hit \(\,\)r \(\,\) to reset.


Overview

The algorithm for finding the cut locus after the polygon is created goes roughly as follows:
  1. Triangulate the polygon
  2. Sample points randomly from each triangle
  3. For each point, precompute distance from each edge of the polygon
  4. If the two shortest distances are within some \(\varepsilon\) (say, 3 pixels), then that point is in the cut locus

Issues

There are many issues with my implementation and this method in general.