Fix #696. Account for multiple coincident edges when looking for naked edges.

This commit is contained in:
phkahler 2020-09-12 17:21:20 -04:00
parent d8f5a8da32
commit e74185b639

View File

@ -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, &parallelInfo);
if (info.count != parallelInfo.count) {
sel->AddEdge(a, b, auxA);
if(leaky) *leaky = true;
}
}
if(info.intersectsMesh) {
sel->AddEdge(a, b, auxA);