summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PolySetCGALEvaluator.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index 6ff1e35..8e08e19 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -176,10 +176,16 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node)
}
catch (const CGAL::Failure_exception &e) {
PRINTB("CGAL error in projection node during bigbox intersection: %s", e.what());
- sum.p3.reset( new CGAL_Nef_polyhedron3() );
+ sum.p3->clear();
}
}
+ if ( sum.p3->is_empty() ) {
+ CGAL::set_error_behaviour(old_behaviour);
+ PRINT("WARNING: projection() failed.");
+ return NULL;
+ }
+
// remove z coordinates to make CGAL_Nef_polyhedron2
log << OpenSCAD::svg_header( 480, 100000 ) << "\n";
try {
@@ -206,11 +212,6 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node)
CGAL::set_error_behaviour(old_behaviour);
- if ( sum.p3->is_empty() ) {
- PRINT("WARNING: projection() failed.");
- return NULL;
- }
-
// Extract polygons in the XY plane, ignoring all other polygons
// FIXME: If the polyhedron is really thin, there might be unwanted polygons
// in the XY plane, causing the resulting 2D polygon to be self-intersection
contact: Jan Huwald // Impressum