From 4fa2338b267bdf6e08385ae103b5bafe7b4ee6e4 Mon Sep 17 00:00:00 2001 From: don bright Date: Mon, 11 Mar 2013 17:40:02 -0700 Subject: fix bug showed during circle test diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 406614f..7c483cb 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -181,9 +181,11 @@ CGAL_Nef_polyhedron CGALEvaluator::applyHull(const CgaladvNode &node) CGAL_Nef_polyhedron CGALEvaluator::applyResize(const CgaladvNode &node) { - // Based on resize() in Giles Bathgate's RapCAD (but not exactly) + // Based on resize() in Giles Bathgate's RapCAD (but not exactly) CGAL_Nef_polyhedron N; - N = applyToChildren(node, CGE_UNION); + N = applyToChildren(node, CGE_UNION); + + if ( N.isNull() || N.isEmpty() ) return N; for (int i=0;i<3;i++) { if (node.newsize[i]<0) { @@ -309,9 +311,7 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node) PRINT("Warning: Transformation matrix contains Not-a-Number and/or Infinity - removing object."); N.reset(); } - else { - N.transform( node.matrix ); - } + N.transform( node.matrix ); } else { N = CGALCache::instance()->get(this->tree.getIdString(node)); diff --git a/src/CGAL_Nef_polyhedron_DxfData.cc b/src/CGAL_Nef_polyhedron_DxfData.cc index f7ff7f3..0388fe5 100644 --- a/src/CGAL_Nef_polyhedron_DxfData.cc +++ b/src/CGAL_Nef_polyhedron_DxfData.cc @@ -128,7 +128,7 @@ void CGAL_Nef_polyhedron::transform( const Transform3d &matrix ) Tree nulltree; CGALEvaluator tmpeval(nulltree); CGAL_Nef_polyhedron N = tmpeval.evaluateCGALMesh(ps); - this->p2.reset( new CGAL_Nef_polyhedron2( *N.p2 ) ); + if ( N.p2 ) this->p2.reset( new CGAL_Nef_polyhedron2( *N.p2 ) ); delete dd; } } -- cgit v0.10.1