Add OpenMP parallel for to SShell::CopyCurvesSplitAgainst

pull/766/head
phkahler 2020-10-22 10:48:27 -04:00
parent 0f1ece2b8e
commit c674bc8fb9
1 changed files with 9 additions and 6 deletions

View File

@ -201,18 +201,21 @@ SCurve SCurve::MakeCopySplitAgainst(SShell *agnstA, SShell *agnstB,
}
void SShell::CopyCurvesSplitAgainst(bool opA, SShell *agnst, SShell *into) {
SCurve *sc;
for(sc = curve.First(); sc; sc = curve.NextAfter(sc)) {
#pragma omp parallel for
for(int i=0; i<curve.n; i++) {
SCurve *sc = &curve[i];
SCurve scn = sc->MakeCopySplitAgainst(agnst, NULL,
surface.FindById(sc->surfA),
surface.FindById(sc->surfB));
scn.source = opA ? SCurve::Source::A : SCurve::Source::B;
#pragma omp critical
{
hSCurve hsc = into->curve.AddAndAssignId(&scn);
// And note the new ID so that we can rewrite the trims appropriately
sc->newH = hsc;
}
}
}
void SSurface::TrimFromEdgeList(SEdgeList *el, bool asUv) {
el->l.ClearTags();