From e74185b63940b4b977cc2f36cc8aeb15d79ac6dc Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Sat, 12 Sep 2020 17:21:20 -0400 Subject: [PATCH] Fix #696. Account for multiple coincident edges when looking for naked edges. --- src/mesh.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 1ef6c17..57377d0 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -971,9 +971,15 @@ void SKdNode::MakeCertainEdgesInto(SEdgeList *sel, EdgeKind how, bool coplanarIs switch(how) { case EdgeKind::NAKED_OR_SELF_INTER: + // there should be one anti-parllel edge if(info.count != 1) { - sel->AddEdge(a, b, auxA); - if(leaky) *leaky = true; + // but there may be multiple parallel coincident edges + SKdNode::EdgeOnInfo parallelInfo = {}; + FindEdgeOn(b, a, -cnt, coplanarIsInter, ¶llelInfo); + if (info.count != parallelInfo.count) { + sel->AddEdge(a, b, auxA); + if(leaky) *leaky = true; + } } if(info.intersectsMesh) { sel->AddEdge(a, b, auxA);