From d8f5a8da32b48a8490bf509e2757249896e06659 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Tue, 8 Sep 2020 13:23:59 -0400 Subject: [PATCH] Fix issue #296. We need to recognize two consecutive bridges as a non-ear. --- src/srf/triangulate.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/srf/triangulate.cpp b/src/srf/triangulate.cpp index d1e0de181..d02f96380 100644 --- a/src/srf/triangulate.cpp +++ b/src/srf/triangulate.cpp @@ -325,6 +325,8 @@ bool SContour::IsEar(int bp, double scaledEps) const { Vector jp = l[j].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 if (!RayIsInside(tr.a, tr.c, p,jp) && !RayIsInside(tr.a, tr.c, p,kp)) continue;