Skip to content

Commit e84fd46

Browse files
authored
Use omp critical to simplify parallel triangulation. NFC.
1 parent c355a47 commit e84fd46

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/srf/surface.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,16 +1050,12 @@ void SShell::MakeSectionEdgesInto(Vector n, double d, SEdgeList *sel, SBezierLis
10501050
}
10511051

10521052
void SShell::TriangulateInto(SMesh *sm) {
1053-
std::vector<SMesh> tm(surface.n);
1054-
10551053
#pragma omp parallel for
10561054
for(int i=0; i<surface.n; i++) {
10571055
SSurface *s = &surface[i];
1058-
s->TriangulateInto(this, &tm[i]);
1059-
}
1060-
1061-
// merge the per-surface meshes
1062-
for (auto& m : tm) {
1056+
SMesh m;
1057+
s->TriangulateInto(this, &m);
1058+
#pragma omp critical
10631059
sm->MakeFromCopyOf(&m);
10641060
m.Clear();
10651061
}

0 commit comments

Comments
 (0)