diff options
author | Marius Kintel <marius@kintel.net> | 2012-10-09 00:45:47 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-10-09 00:45:47 (GMT) |
commit | 750e1f9f649e0908bf1d89c9e31d61ef0f56fe7f (patch) | |
tree | 9f02a267090279dd6478b96b68d0fec880fc9efc /src/CGALEvaluator.cc | |
parent | 9c9781334aee87f32926cfd465839c4e5026a65d (diff) |
Catch exceptions as const references. Fixes #204
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r-- | src/CGALEvaluator.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 064a36a..5e16892 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -81,15 +81,13 @@ void CGALEvaluator::process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedr break; } } - catch (CGAL::Failure_exception e) { - // union && difference assert triggered by testdata/scad/bugs/rotate-diff-nonmanifold-crash.scad + catch (const CGAL::Failure_exception &e) { + // union && difference assert triggered by testdata/scad/bugs/rotate-diff-nonmanifold-crash.scad and testdata/scad/bugs/issue204.scad std::string opstr = op == CGE_UNION ? "union" : op == CGE_INTERSECTION ? "intersection" : op == CGE_DIFFERENCE ? "difference" : op == CGE_MINKOWSKI ? "minkowski" : "UNKNOWN"; PRINTB("CGAL error in CGAL_Nef_polyhedron's %s operator: %s", opstr % e.what()); - // Minkowski errors can result in corrupt polyhedrons - if (op == CGE_MINKOWSKI) { - target = src; - } + // Errors can result in corrupt polyhedrons, so put back the old one + target = src; } CGAL::set_error_behaviour(old_behaviour); } @@ -649,7 +647,7 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps) N = new CGAL_Nef_polyhedron3(*P); } } - catch (CGAL::Assertion_exception e) { + catch (const CGAL::Assertion_exception &e) { PRINTB("CGAL error in CGAL_Nef_polyhedron3(): %s", e.what()); } CGAL::set_error_behaviour(old_behaviour); |