From c39c430ca0afd93a7b9199292fca5c613384441f Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 18 Jul 2012 21:05:04 -0500 Subject: add crashing scad example to testdata diff --git a/testdata/scad/bugs/issue148.scad b/testdata/scad/bugs/issue148.scad new file mode 100644 index 0000000..29ccd51 --- /dev/null +++ b/testdata/scad/bugs/issue148.scad @@ -0,0 +1,2 @@ +scale([8,8,0]) + linear_extrude(file="../../circle.dxf"); -- cgit v0.10.1 From 4750709867e0f5743934a20250ca0990472b7a4f Mon Sep 17 00:00:00 2001 From: don bright Date: Fri, 20 Jul 2012 08:49:27 +0200 Subject: fix crashbug, rept by MichaelAtOz, issue 148. add test. diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index a570df4..1b307be 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -253,7 +253,7 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node) testmat << node.matrix(0,0), node.matrix(0,1), node.matrix(1,0), node.matrix(1,1); if (testmat.determinant() == 0) { PRINT("Warning: Scaling a 2D object with 0 - removing object"); - N.p2.reset(); + N.reset(); } else { CGAL_Aff_transformation2 t( @@ -279,7 +279,7 @@ Response CGALEvaluator::visit(State &state, const TransformNode &node) else if (N.dim == 3) { if (node.matrix.matrix().determinant() == 0) { PRINT("Warning: Scaling a 3D object with 0 - removing object"); - N.p3.reset(); + N.reset(); } else { CGAL_Aff_transformation t( diff --git a/src/CGAL_Nef_polyhedron.h b/src/CGAL_Nef_polyhedron.h index 0b0784e..64ee9eb 100644 --- a/src/CGAL_Nef_polyhedron.h +++ b/src/CGAL_Nef_polyhedron.h @@ -14,6 +14,7 @@ public: ~CGAL_Nef_polyhedron() {} bool empty() const { return (dim == 0 || (!p2 && !p3)); } + void reset() { dim=0; p2.rest(); p3.reset(); } CGAL_Nef_polyhedron &operator+=(const CGAL_Nef_polyhedron &other); CGAL_Nef_polyhedron &operator*=(const CGAL_Nef_polyhedron &other); CGAL_Nef_polyhedron &operator-=(const CGAL_Nef_polyhedron &other); diff --git a/testdata/scad/bugs/issue148.scad b/testdata/scad/bugs/issue148.scad deleted file mode 100644 index 29ccd51..0000000 --- a/testdata/scad/bugs/issue148.scad +++ /dev/null @@ -1,2 +0,0 @@ -scale([8,8,0]) - linear_extrude(file="../../circle.dxf"); diff --git a/testdata/scad/dxf/scale-with-0.scad b/testdata/scad/dxf/scale-with-0.scad new file mode 100644 index 0000000..c4f6a9d --- /dev/null +++ b/testdata/scad/dxf/scale-with-0.scad @@ -0,0 +1,3 @@ +// https://github.com/openscad/openscad/issues/148 +scale([8,8,0]) + linear_extrude(file="../../circle.dxf"); -- cgit v0.10.1 From f0215e86c8baa1a45af9c2c9828398d29e425beb Mon Sep 17 00:00:00 2001 From: don bright Date: Fri, 20 Jul 2012 08:51:50 +0200 Subject: remove test pending decision on backwards compatability diff --git a/testdata/scad/dxf/scale-with-0.scad b/testdata/scad/dxf/scale-with-0.scad deleted file mode 100644 index c4f6a9d..0000000 --- a/testdata/scad/dxf/scale-with-0.scad +++ /dev/null @@ -1,3 +0,0 @@ -// https://github.com/openscad/openscad/issues/148 -scale([8,8,0]) - linear_extrude(file="../../circle.dxf"); -- cgit v0.10.1 From 8e9b2d2c491ccafd5cb14919f750aa537ebdcc04 Mon Sep 17 00:00:00 2001 From: don bright Date: Fri, 20 Jul 2012 09:00:14 +0200 Subject: fix typo diff --git a/src/CGAL_Nef_polyhedron.h b/src/CGAL_Nef_polyhedron.h index 64ee9eb..694b420 100644 --- a/src/CGAL_Nef_polyhedron.h +++ b/src/CGAL_Nef_polyhedron.h @@ -14,7 +14,7 @@ public: ~CGAL_Nef_polyhedron() {} bool empty() const { return (dim == 0 || (!p2 && !p3)); } - void reset() { dim=0; p2.rest(); p3.reset(); } + void reset() { dim=0; p2.reset(); p3.reset(); } CGAL_Nef_polyhedron &operator+=(const CGAL_Nef_polyhedron &other); CGAL_Nef_polyhedron &operator*=(const CGAL_Nef_polyhedron &other); CGAL_Nef_polyhedron &operator-=(const CGAL_Nef_polyhedron &other); -- cgit v0.10.1