diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-11-27 02:04:57 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-11-27 02:04:57 (GMT) |
commit | cf9f19818ca5886275019f8e93c7fb8ec0e4bde6 (patch) | |
tree | 0c7da8f9138d12b6604981c5cfeb017389a8e7ff /src/export.cc | |
parent | b204aba444bd838bd3fe27675323dce6d4123b19 (diff) |
prevent crash in CGAL nef3. fix #issue 410 . also deal w qmake bug re .h files
Diffstat (limited to 'src/export.cc')
-rw-r--r-- | src/export.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/export.cc b/src/export.cc index ec6e576..cef323e 100644 --- a/src/export.cc +++ b/src/export.cc @@ -42,7 +42,12 @@ void export_stl(CGAL_Nef_polyhedron *root_N, std::ostream &output) CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION); try { CGAL_Polyhedron P; - root_N->p3->convert_to_Polyhedron(P); + //root_N->p3->convert_to_Polyhedron(P); + bool err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(root_N->p3), P ); + if (err) { + PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed"); + return; + } typedef CGAL_Polyhedron::Vertex Vertex; typedef CGAL_Polyhedron::Vertex_const_iterator VCI; @@ -114,6 +119,9 @@ void export_stl(CGAL_Nef_polyhedron *root_N, std::ostream &output) catch (const CGAL::Assertion_exception &e) { PRINTB("CGAL error in CGAL_Nef_polyhedron3::convert_to_Polyhedron(): %s", e.what()); } + catch (...) { + PRINT("CGAL unknown error in CGAL_Nef_polyhedron3::convert_to_Polyhedron()"); + } CGAL::set_error_behaviour(old_behaviour); } |