diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-12-15 21:32:06 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-12-15 21:32:06 (GMT) |
commit | 3b3ef44f6636affef8138f4c8b7dec1333f50377 (patch) | |
tree | 977698cc6d2d56775f140967792ad637db03490f /src/CGAL_Nef_polyhedron.cc | |
parent | 5271b345bc755f37e98d7f497f6686d34990fa5c (diff) | |
parent | c7cea0082e427f3c53985845f05e8737873c8a25 (diff) |
Merge branch 'master' of github.com:openscad/openscad into planar
Conflicts:
src/CGAL_Nef_polyhedron.cc
tests/CMakeLists.txt
Diffstat (limited to 'src/CGAL_Nef_polyhedron.cc')
-rw-r--r-- | src/CGAL_Nef_polyhedron.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/CGAL_Nef_polyhedron.cc b/src/CGAL_Nef_polyhedron.cc index 8b54eba..ea9accd 100644 --- a/src/CGAL_Nef_polyhedron.cc +++ b/src/CGAL_Nef_polyhedron.cc @@ -96,16 +96,23 @@ PolySet *CGAL_Nef_polyhedron::convertToPolyset() } else if (this->dim == 3) { CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION); + ps = new PolySet(); + bool err = true; + std::string errmsg(""); + CGAL_Polyhedron P; try { - ps = new PolySet(); - CGAL_Polyhedron P; - this->p3->convert_to_Polyhedron(P); - bool err = createPolySetFromPolyhedron(P, *ps); - if (err) delete ps; + err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(this->p3), P ); + //this->p3->convert_to_Polyhedron(P); + } + catch (const CGAL::Failure_exception &e) { + err = true; + errmsg = std::string(e.what()); } - catch (const CGAL::Precondition_exception &e) { - delete ps; - PRINTB("CGAL error in CGAL_Nef_polyhedron::convertToPolyset(): %s", e.what()); + if (!err) err = createPolySetFromPolyhedron(P, *ps); + if (err) { + PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed."); + if (errmsg!="") PRINTB("ERROR: %s",errmsg); + delete ps; ps = NULL; } CGAL::set_error_behaviour(old_behaviour); } |