Tektosyne 6.2.0 is now available for download. This is another bugfix release, again mostly based on feedback from Github user Mushrooms (sf17k) (thanks!). You can find a summary in the What’s New file. As before, the library itself requires Java 8 while the IntelliJ project and demo application are based on Java 9.0.4.
Voronoi Diagrams
I discovered yet another bug concerning Voronoi region creation in class VoronoiResults
, this time concerning edges that exactly hit the corners of the clipping rectangle. Unit-tested and fixed.
User sf17k requested support for Voronoi diagrams with just two generator sites, a case ignored by the standard literature as far as I know. But it wasn’t hard to implement, except for (predictably) the creation of Voronoi regions. That code is pretty much entirely rewritten by now…
Planar Subdivisions
I didn’t have unit tests for Subdivision.intersection
, a fairly massive algorithm that computes the overlay of two planar subdivisions. That turned out to be a mistake, as sf17k discovered a sizable error in the code that maps faces of the output subdivision to those of the two input subdivisions.
The error occurred whenever a particular output face was bounded only by edges of one of the two input subdivisions, but none of the other’s. In that case the output face would always map to the unbounded face of that other input. I broadened the search to adjacent egde cycles and finally a (hopefully rarely needed) brute-force face location where necessary. Subdivision intersections are now also properly unit-tested.
Lastly, sf17k asked for custom mappings not just for subdivision faces, as provided by SubdivisionMap
, but also for edges and vertices. The simplest and most consistent solution was to extend the SubdivisionMap
interface, so now there’s also a SubdivisionFullMap
interface that provides the additional conversion methods. All have default implementations that simply throw exceptions, so you can implement just the ones you want.