NFC replace 2 nested loops with 1 loop and a lookup for speed improvement.

pull/687/head
phkahler 2020-08-15 17:47:40 -04:00
parent bc4924ae47
commit d974615d0e
1 changed files with 38 additions and 39 deletions

View File

@ -454,16 +454,16 @@ SSurface SSurface::MakeCopyTrimAgainst(SShell *parent,
SEdgeList inter = {};
SSurface *ss;
for(ss = agnst->surface.First(); ss; ss = agnst->surface.NextAfter(ss)) {
SCurve *sc;
for(sc = into->curve.First(); sc; sc = into->curve.NextAfter(sc)) {
if(sc->source != SCurve::Source::INTERSECTION) continue;
if(opA) {
if(sc->surfA != h || sc->surfB != ss->h) continue;
if(sc->surfA != h) continue;
ss = shb->surface.FindById(sc->surfB);
} else {
if(sc->surfB != h || sc->surfA != ss->h) continue;
if(sc->surfB != h) continue;
ss = sha->surface.FindById(sc->surfA);
}
int i;
for(i = 1; i < sc->pts.n; i++) {
Vector a = sc->pts[i-1].p,
@ -500,7 +500,6 @@ SSurface SSurface::MakeCopyTrimAgainst(SShell *parent,
}
}
}
}
// Record all the points where more than two edges join, which I will call
// the choosing points. If two edges join at a non-choosing point, then