Improve performance of mesh-forced assemblies.

pull/252/merge
EvilSpirit 2017-09-01 00:42:50 +07:00 committed by whitequark
parent c8fc033047
commit 025bb960c0
1 changed files with 8 additions and 4 deletions

View File

@ -357,10 +357,14 @@ void Group::GenerateShellAndMesh() {
// and corresponding slowdown. // and corresponding slowdown.
outm.RemoveDegenerateTriangles(); outm.RemoveDegenerateTriangles();
// And make sure that the output mesh is vertex-to-vertex. if(srcg->meshCombine != CombineAs::ASSEMBLE) {
SKdNode *root = SKdNode::From(&outm); // And make sure that the output mesh is vertex-to-vertex.
root->SnapToMesh(&outm); SKdNode *root = SKdNode::From(&outm);
root->MakeMeshInto(&runningMesh); root->SnapToMesh(&outm);
root->MakeMeshInto(&runningMesh);
} else {
runningMesh.MakeFromCopyOf(&outm);
}
outm.Clear(); outm.Clear();
thism.Clear(); thism.Clear();