Use OpenMP for triangulation

pull/598/head^2
phkahler 2020-04-30 17:11:59 -04:00
parent 7baf58588b
commit b4e1ce44e8
1 changed files with 12 additions and 3 deletions

View File

@ -1050,9 +1050,18 @@ void SShell::MakeSectionEdgesInto(Vector n, double d, SEdgeList *sel, SBezierLis
} }
void SShell::TriangulateInto(SMesh *sm) { void SShell::TriangulateInto(SMesh *sm) {
SSurface *s; std::vector<SMesh> tm(surface.n);
for(s = surface.First(); s; s = surface.NextAfter(s)) {
s->TriangulateInto(this, sm); #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) {
sm->MakeFromCopyOf(&m);
m.Clear();
} }
} }