summaryrefslogtreecommitdiff
path: root/src/csgops.cc
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-06-27 01:34:46 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-06-27 01:34:46 (GMT)
commit2a793422cad6215100c2ab0aff515bb5e9a11d69 (patch)
treecc97ae8d98d9179c42a2ec0e61e56e46d155460a /src/csgops.cc
parent7ecdd8e75eb5a994c620e242ee6a9a4cc5e04b57 (diff)
Catch some more CGAL exceptions which were encountered
git-svn-id: http://svn.clifford.at/openscad/trunk@564 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/csgops.cc')
-rw-r--r--src/csgops.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/csgops.cc b/src/csgops.cc
index 508eecc..ae97085 100644
--- a/src/csgops.cc
+++ b/src/csgops.cc
@@ -30,6 +30,8 @@
#include "printutils.h"
#ifdef ENABLE_CGAL
# include "cgal.h"
+# include <CGAL/assertions_behaviour.h>
+# include <CGAL/exceptions.h>
#endif
enum csg_type_e {
@@ -82,8 +84,10 @@ CGAL_Nef_polyhedron CsgNode::render_cgal_nef_polyhedron() const
print_messages_push();
+ CGAL::Failure_behaviour old_behaviour = CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
bool first = true;
CGAL_Nef_polyhedron N;
+ try {
foreach (AbstractNode *v, children) {
if (v->modinst->tag_background)
continue;
@@ -110,8 +114,13 @@ CGAL_Nef_polyhedron CsgNode::render_cgal_nef_polyhedron() const
}
v->progress_report();
}
-
cgal_nef_cache.insert(cache_id, new cgal_nef_cache_entry(N), N.weight());
+ }
+ catch (CGAL::Assertion_exception e) {
+ PRINTF("ERROR: Illegal polygonal object - make sure all polygons are defined with the same winding order. Skipping affected object.");
+ }
+ CGAL::set_error_behaviour(old_behaviour);
+
print_messages_pop();
progress_report();
contact: Jan Huwald // Impressum