Revert "Use number_of_parts for is_splittable"

It is too dangerous to rely on the admesh flag without inspecting the
admesh code line by line and a through test.

This reverts commit cd3cec3e45.
This commit is contained in:
bubnikv 2019-04-01 12:27:45 +02:00
parent cd3cec3e45
commit d728f4be5e
4 changed files with 25 additions and 1 deletions

View file

@ -338,6 +338,19 @@ void TriangleMesh::rotate(double angle, Point* center)
this->translate(c(0), c(1), 0);
}
/**
* Calculates whether or not the mesh is splittable.
*/
bool TriangleMesh::is_splittable() const
{
std::vector<bool> visited;
find_unvisited_neighbors(visited);
// Try finding an unvisited facet. If there are none, the mesh is not splittable.
auto it = std::find(visited.begin(), visited.end(), false);
return it != visited.end();
}
/**
* Visit all unvisited neighboring facets that are reachable from the first unvisited facet,
* and return them.