We need to recognize two consecutive bridges as a non-ear.
This commit is contained in:
phkahler 2020-09-08 13:23:59 -04:00
parent 705249627a
commit d8f5a8da32

View File

@ -325,6 +325,8 @@ bool SContour::IsEar(int bp, double scaledEps) const {
Vector jp = l[j].p; Vector jp = l[j].p;
Vector kp = l[k].p; Vector kp = l[k].p;
// two consecutive bridges (A,B,C) and later (C,B,A) are not an ear
if (jp.Equals(tr.c) && kp.Equals(tr.a)) return false;
// check both edges from the point in question // check both edges from the point in question
if (!RayIsInside(tr.a, tr.c, p,jp) && !RayIsInside(tr.a, tr.c, p,kp)) if (!RayIsInside(tr.a, tr.c, p,jp) && !RayIsInside(tr.a, tr.c, p,kp))
continue; continue;