Use omp critical to simplify parallel triangulation. NFC.
This commit is contained in:
parent
c355a4730a
commit
e84fd4649b
@ -1050,16 +1050,12 @@ void SShell::MakeSectionEdgesInto(Vector n, double d, SEdgeList *sel, SBezierLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SShell::TriangulateInto(SMesh *sm) {
|
void SShell::TriangulateInto(SMesh *sm) {
|
||||||
std::vector<SMesh> tm(surface.n);
|
|
||||||
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for(int i=0; i<surface.n; i++) {
|
for(int i=0; i<surface.n; i++) {
|
||||||
SSurface *s = &surface[i];
|
SSurface *s = &surface[i];
|
||||||
s->TriangulateInto(this, &tm[i]);
|
SMesh m;
|
||||||
}
|
s->TriangulateInto(this, &m);
|
||||||
|
#pragma omp critical
|
||||||
// merge the per-surface meshes
|
|
||||||
for (auto& m : tm) {
|
|
||||||
sm->MakeFromCopyOf(&m);
|
sm->MakeFromCopyOf(&m);
|
||||||
m.Clear();
|
m.Clear();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user