From e84fd4649b05fe250ba3fcb7bc4ccd73a764ba68 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Mon, 11 May 2020 14:57:02 -0400 Subject: [PATCH] Use omp critical to simplify parallel triangulation. NFC. --- src/srf/surface.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/srf/surface.cpp b/src/srf/surface.cpp index a7be9682..6afcc791 100644 --- a/src/srf/surface.cpp +++ b/src/srf/surface.cpp @@ -1050,16 +1050,12 @@ void SShell::MakeSectionEdgesInto(Vector n, double d, SEdgeList *sel, SBezierLis } void SShell::TriangulateInto(SMesh *sm) { - std::vector tm(surface.n); - #pragma omp parallel for for(int i=0; iTriangulateInto(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(); }