Workaround for deadlock in face/hole merge function in carve

which could happen in cases of degenerated faces.
This commit is contained in:
Sergey Sharybin 2013-02-05 14:27:24 +00:00
parent 4c3d5a4294
commit 25cbd13d22

@ -719,6 +719,10 @@ namespace {
unassigned--; unassigned--;
} }
} }
if (!removed.size())
throw carve::exception("Failed to merge holes");
for (std::set<int>::iterator f = removed.begin(); f != removed.end(); ++f) { for (std::set<int>::iterator f = removed.begin(); f != removed.end(); ++f) {
for (unsigned i = 0; i < containing_faces.size(); ++i) { for (unsigned i = 0; i < containing_faces.size(); ++i) {
containing_faces[i].erase(std::remove(containing_faces[i].begin(), containing_faces[i].erase(std::remove(containing_faces[i].begin(),