mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 22:24:01 -06:00
Make new split always default if feasible
This commit is contained in:
parent
97529ff6b7
commit
0ca17b0798
1 changed files with 31 additions and 18 deletions
|
@ -451,9 +451,21 @@ std::deque<uint32_t> TriangleMesh::find_unvisited_neighbors(std::vector<unsigned
|
|||
*/
|
||||
TriangleMeshPtrs TriangleMesh::split() const
|
||||
{
|
||||
struct MeshAdder {
|
||||
TriangleMeshPtrs &meshes;
|
||||
MeshAdder(TriangleMeshPtrs &ptrs): meshes{ptrs} {}
|
||||
void operator=(const indexed_triangle_set &its)
|
||||
{
|
||||
meshes.emplace_back(new TriangleMesh(its));
|
||||
}
|
||||
};
|
||||
|
||||
TriangleMeshPtrs meshes;
|
||||
if (has_shared_vertices()) {
|
||||
its_split(its, MeshAdder{meshes});
|
||||
} else {
|
||||
// Loop while we have remaining facets.
|
||||
std::vector<unsigned char> facet_visited;
|
||||
TriangleMeshPtrs meshes;
|
||||
for (;;) {
|
||||
std::deque<uint32_t> facets = find_unvisited_neighbors(facet_visited);
|
||||
if (facets.empty())
|
||||
|
@ -474,6 +486,7 @@ TriangleMeshPtrs TriangleMesh::split() const
|
|||
stl_facet_stats(&mesh->stl, this->stl.facet_start[*facet], first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return meshes;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue