mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-11 03:21:57 +08:00
Make new split always default if feasible
This commit is contained in:
parent
97529ff6b7
commit
0ca17b0798
@ -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…
x
Reference in New Issue
Block a user