Move repaired check to find_unvisited_neighbors

This commit is contained in:
Sijmen Schoon 2019-03-28 12:39:57 +01:00 committed by bubnikv
parent 69199215b0
commit 4a9e05194c

View file

@ -361,6 +361,10 @@ bool TriangleMesh::is_splittable() const
*/
std::deque<uint32_t> TriangleMesh::find_unvisited_neighbors(std::vector<bool> &facet_visited) const
{
// Make sure we're not operating on a broken mesh.
if (!this->repaired)
throw std::runtime_error("split() requires repair()");
// If the visited list is empty, populate it with false for every facet.
if (facet_visited.empty()) {
facet_visited = std::vector<bool>(this->stl.stats.number_of_facets, false);
@ -397,10 +401,6 @@ std::deque<uint32_t> TriangleMesh::find_unvisited_neighbors(std::vector<bool> &f
*/
TriangleMeshPtrs TriangleMesh::split() const
{
// Make sure we're not operating on a broken mesh.
if (!this->repaired)
throw std::runtime_error("split() requires repair()");
// Loop while we have remaining facets.
std::vector<bool> facet_visited;
TriangleMeshPtrs meshes;