summaryrefslogtreecommitdiff
path: root/src/CGALEvaluator.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-11-27 02:04:57 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-11-27 02:04:57 (GMT)
commitcf9f19818ca5886275019f8e93c7fb8ec0e4bde6 (patch)
tree0c7da8f9138d12b6604981c5cfeb017389a8e7ff /src/CGALEvaluator.cc
parentb204aba444bd838bd3fe27675323dce6d4123b19 (diff)
prevent crash in CGAL nef3. fix #issue 410 . also deal w qmake bug re .h files
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r--src/CGALEvaluator.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index ec01315..242fe0f 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -159,9 +159,19 @@ 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;
+ try{
+ err = nefworkaround::convert_to_Polyhedron<CGAL_Kernel3>( *(chN.p3), P );
+ //chN.p3->convert_to_Polyhedron(P);
+ } catch (...) {
+ err = true;
+ }
+ if (err) {
+ PRINT("ERROR: CGAL NefPolyhedron->Polyhedron conversion failed");
+ } 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