Fix error reporting when cgal mesh boolean crashes.

Change error report when catching SEH on cgal mesh boolean.
This commit is contained in:
tamasmeszaros 2021-06-22 18:13:35 +02:00
parent 48cd3b21b6
commit 2096a6dbbf
2 changed files with 6 additions and 3 deletions

View file

@ -208,16 +208,20 @@ static bool _cgal_intersection(CGALMesh &A, CGALMesh &B, CGALMesh &R)
template<class Op> void _cgal_do(Op &&op, CGALMesh &A, CGALMesh &B)
{
bool success = false;
bool hw_fail = false;
try {
CGALMesh result;
try_catch_signal({SIGSEGV, SIGFPE}, [&success, &A, &B, &result, &op] {
success = op(A, B, result);
}, [&] { success = false; });
}, [&] { hw_fail = true; });
A = std::move(result); // In-place operation does not work
} catch (...) {
success = false;
}
if (hw_fail)
throw Slic3r::HardCrash("CGAL mesh boolean operation crashed.");
if (! success)
throw Slic3r::RuntimeError("CGAL mesh boolean operation failed.");
}