mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-12-28 13:43:30 +01:00
Disable tolerance in Orient2d collinearity test
This fixes failures for me when trying to triangulate concave-by-less-than-epsilon boundary polylines.
This commit is contained in:
parent
8b5fa15800
commit
57b3039c05
@ -68,7 +68,10 @@ Orientation Orient2d(const Point& pa, const Point& pb, const Point& pc)
|
||||
double detleft = (pa.x - pc.x) * (pb.y - pc.y);
|
||||
double detright = (pa.y - pc.y) * (pb.x - pc.x);
|
||||
double val = detleft - detright;
|
||||
if (val > -EPSILON && val < EPSILON) {
|
||||
|
||||
// Using a tolerance here fails on concave-by-subepsilon boundaries
|
||||
// if (val > -EPSILON && val < EPSILON) {
|
||||
if (val == 0) {
|
||||
return COLLINEAR;
|
||||
} else if (val > 0) {
|
||||
return CCW;
|
||||
|
Loading…
Reference in New Issue
Block a user