Open icedevelopment opened 2 years ago
I also encountered this issue, managed to narrow it down: this issue only happens if there is a steiner point on a boundary edge, and the point is sorted in a specific way internally so that in the Sweep::EdgeEvent function, the if (o1 == COLLINEAR) { ...
branch is entered. If the other branch, if (o2 == COLLINEAR) { ...
is entered, then it works fine.
Some examples:
1) Bad triangulation Input points: (1, 3) (3, 3) (3, 1) Steiner point: (3, 2)
2) Good triangulation Input points: (1, 3) (3, 3) (5, 3) (3, 1) Steiner point: (3, 2)
3) Good triangulation Input points: (1, 3) (3, 3) (5, 3) (3, 1) Steiner point: (2, 2)
4) Bad triangulation Input points: (1, 3) (3, 3) (5, 3) (3, 1) Steiner point: (4, 2)
In particular configurations the generated triangles use the SweepContext::head and SweepContext::tail points in the final triangles list. These points are out of bound.
Here is the smallest test case I have found.
Did I miss something?