summaryrefslogtreecommitdiff
path: root/src/CGALEvaluator.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-12-09 04:12:13 (GMT)
committerMarius Kintel <marius@kintel.net>2013-12-09 04:12:13 (GMT)
commit462d4d447885594629fefb8a658f9f1d079bcc44 (patch)
tree6690951e4f814b87a1a372a913b75ceda1f6cc1a /src/CGALEvaluator.cc
parent435e0c021c5018ee5de69d3218c3e31c8ab75be5 (diff)
parent33c34b6f7c43d19bbfa3bf91e7b577bcc062e5bd (diff)
Merge branch 'master' into travis
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r--src/CGALEvaluator.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index ec01315..86118d7 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -159,9 +159,21 @@ CGAL_Nef_polyhedron CGALEvaluator::applyHull(const CgaladvNode &node)
PRINT("Hull() currently requires a valid 2-manifold. Please modify your design. See http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/STL_Import_and_Export");
}
else {
- chN.p3->convert_to_Polyhedron(P);
- std::transform(P.vertices_begin(), P.vertices_end(), std::back_inserter(points3d),
- boost::bind(static_cast<const CGAL_Polyhedron::Vertex::Point_3&(CGAL_Polyhedron::Vertex::*)() const>(&CGAL_Polyhedron::Vertex::point), _1));
+ bool err = false;
+ std::string errmsg("");
+ try {
+ err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(chN.p3), P );
+ //chN.p3->convert_to_Polyhedron(P);
+ } catch (const CGAL::Failure_exception &e) {
+ err = true;
+ errmsg = std::string(e.what());
+ }
+ if (err) {
+ PRINTB("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed. %s", errmsg);
+ } else {
+ std::transform(P.vertices_begin(), P.vertices_end(), std::back_inserter(points3d),
+ boost::bind(static_cast<const CGAL_Polyhedron::Vertex::Point_3&(CGAL_Polyhedron::Vertex::*)() const>(&CGAL_Polyhedron::Vertex::point), _1));
+ }
}
}
chnode->progress_report();
contact: Jan Huwald // Impressum