Skip to content

Commit

Permalink
Fix issue #296.
Browse files Browse the repository at this point in the history
We need to recognize two consecutive bridges as a non-ear.
  • Loading branch information
phkahler committed Sep 8, 2020
1 parent 7052496 commit d8f5a8d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/srf/triangulate.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit d8f5a8d

Please sign in to comment.