Skip to content

Commit 8a3e5b4

Browse files
committed
Don't do numeric surface intersections if an exact curve has been copied. We don't want 2 overlapping but different sets of PWLs.
1 parent eadeac4 commit 8a3e5b4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/srf/surfinter.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ void SSurface::IntersectAgainst(SSurface *b, SShell *agnstA, SShell *agnstB,
331331
sext = this;
332332
shext = agnstA;
333333
}
334+
bool foundExact = false;
334335
SCurve *sc;
335336
for(sc = shext->curve.First(); sc; sc = shext->curve.NextAfter(sc)) {
336337
if(sc->source == SCurve::Source::INTERSECTION) continue;
@@ -341,8 +342,14 @@ void SSurface::IntersectAgainst(SSurface *b, SShell *agnstA, SShell *agnstB,
341342
if(splane->ContainsPlaneCurve(sc)) {
342343
SBezier bezier = sc->exact;
343344
AddExactIntersectionCurve(&bezier, b, agnstA, agnstB, into);
345+
foundExact = true;
344346
}
345347
}
348+
// if we found at lest one of these we don't want to do the numerical
349+
// intersection as well. Sometimes it will also find the same curve but
350+
// with different PWLs and the polygon will fail to assemble.
351+
if(foundExact)
352+
return;
346353
}
347354

348355
// Try intersecting the surfaces numerically, by a marching algorithm.

0 commit comments

Comments
 (0)