summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-05-04 23:26:09 (GMT)
committerMarius Kintel <marius@kintel.net>2013-05-04 23:26:09 (GMT)
commite09d1df0e1d304eedba36494535848e64631b22d (patch)
tree8d7524576f1ed7dc1a8b4d5957486fb81a0d6a76
parentffe750d87e747a57f7bf85281b87e4894cbf92b2 (diff)
parentc4cae2a29a7df82f4f1b43543e6b22b642a275b0 (diff)
Merge branch 'master' into local-scope
-rw-r--r--src/CGALEvaluator.cc3
-rw-r--r--testdata/scad/features/hull2-tests.scad8
-rw-r--r--testdata/scad/features/hull3-tests.scad9
-rw-r--r--tests/regression/dumptest/hull2-tests-expected.txt6
-rw-r--r--tests/regression/dumptest/hull3-tests-expected.txt6
5 files changed, 32 insertions, 0 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index 6ad9e4d..d0140fa 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -141,6 +141,9 @@ CGAL_Nef_polyhedron CGALEvaluator::applyHull(const CgaladvNode &node)
PRINT("WARNING: hull() does not support mixing 2D and 3D objects.");
continue;
}
+ if (chN.isNull()) { // If one of the children evaluated to a null object
+ continue;
+ }
if (dim == 2) {
CGAL_Nef_polyhedron2::Explorer explorer = chN.p2->explorer();
BOOST_FOREACH(const CGAL_Nef_polyhedron2::Explorer::Vertex &vh,
diff --git a/testdata/scad/features/hull2-tests.scad b/testdata/scad/features/hull2-tests.scad
index e656e6a..82b56e4 100644
--- a/testdata/scad/features/hull2-tests.scad
+++ b/testdata/scad/features/hull2-tests.scad
@@ -31,7 +31,15 @@ module hull2dForLoop() {
}
}
+module hull2null() {
+ hull() {
+ square(0);
+ circle(0);
+ }
+}
+
convex2dHole();
translate([40,0,0]) convex2dSimple();
translate([0,-20,0]) concave2dSimple();
translate([30,-25,0]) hull2dForLoop();
+hull2null(); \ No newline at end of file
diff --git a/testdata/scad/features/hull3-tests.scad b/testdata/scad/features/hull3-tests.scad
index e3fc8e7..0f48b8f 100644
--- a/testdata/scad/features/hull3-tests.scad
+++ b/testdata/scad/features/hull3-tests.scad
@@ -26,3 +26,12 @@ translate([-5,-5,-5]) {
}
}
}
+
+module hull3null() {
+ hull() {
+ cube(0);
+ sphere(0);
+ }
+}
+hull3null();
+
diff --git a/tests/regression/dumptest/hull2-tests-expected.txt b/tests/regression/dumptest/hull2-tests-expected.txt
index e4c5a5b..c14282f 100644
--- a/tests/regression/dumptest/hull2-tests-expected.txt
+++ b/tests/regression/dumptest/hull2-tests-expected.txt
@@ -56,4 +56,10 @@
}
}
}
+ group() {
+ hull() {
+ square(size = [0, 0], center = false);
+ circle($fn = 0, $fa = 12, $fs = 2, r = 0);
+ }
+ }
diff --git a/tests/regression/dumptest/hull3-tests-expected.txt b/tests/regression/dumptest/hull3-tests-expected.txt
index 4c05e2c..f8def3b 100644
--- a/tests/regression/dumptest/hull3-tests-expected.txt
+++ b/tests/regression/dumptest/hull3-tests-expected.txt
@@ -27,4 +27,10 @@
}
}
}
+ group() {
+ hull() {
+ cube(size = [0, 0, 0], center = false);
+ sphere($fn = 0, $fa = 12, $fs = 2, r = 0);
+ }
+ }
contact: Jan Huwald // Impressum