locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.94k stars 442 forks source link

Fix IncrementalDelaunayTriangulator to ensure triangulation boundary is convex #1004

Closed dr-jts closed 1 year ago

dr-jts commented 1 year ago

This adds logic to IncrementalDelaunayTriangulator to ensure that the triangulation boundary is always convex (as per specification). This is required because the "frame" created to contain the triangulation construction is not infinitely distant from the input points. This has been causing robustness failures in cases where a site lies very close to the convex hull of the input.

The logic required is additional checks when determining whether to flip an edge to maintain the Delaunay condition :

The reason this code was not included in the original development of IncrementalDelaunayTriangulator is that it is not mentioned in most descriptions of the algorithm. The logic is described in this blog post, and also appears in the triangle code (lines 8592-8614).

This is a more robust solution than the frame size increase in #931.

Fixes #1002. Fixes #477.

Also fixes various issues reported for ConcaveHull ( https://github.com/libgeos/geos/issues/719, https://github.com/libgeos/geos/issues/946)