Use OpenMP for triangulation
parent
7baf58588b
commit
b4e1ce44e8
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue