Use omp critical to simplify parallel triangulation. NFC.

pull/609/head
phkahler 2020-05-11 14:57:02 -04:00 committed by GitHub
parent c355a4730a
commit e84fd4649b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -1050,16 +1050,12 @@ void SShell::MakeSectionEdgesInto(Vector n, double d, SEdgeList *sel, SBezierLis
}
void SShell::TriangulateInto(SMesh *sm) {
std::vector<SMesh> tm(surface.n);
#pragma omp parallel for
for(int i=0; i<surface.n; i++) {
SSurface *s = &surface[i];
s->TriangulateInto(this, &tm[i]);
}
// merge the per-surface meshes
for (auto& m : tm) {
SMesh m;
s->TriangulateInto(this, &m);
#pragma omp critical
sm->MakeFromCopyOf(&m);
m.Clear();
}