From bc7ff5aa8d73ff08bd847bc8d0f41dc26deee54e Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 27 Dec 2012 17:30:13 +0100 Subject: Ignore dimension when evaluating control modules mixed with geometry children. Fixes #229 diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 5e16892..a4744c2 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -130,6 +130,7 @@ CGAL_Nef_polyhedron CGALEvaluator::applyHull(const CgaladvNode &node) const CGAL_Nef_polyhedron &chN = item.second; // FIXME: Don't use deep access to modinst members if (chnode->modinst->isBackground()) continue; + if (chN.dim == 0) continue; // Ignore object with dimension 0 (e.g. echo) if (dim == 0) { dim = chN.dim; } diff --git a/testdata/scad/features/control-hull-dimension.scad b/testdata/scad/features/control-hull-dimension.scad new file mode 100644 index 0000000..c8736db --- /dev/null +++ b/testdata/scad/features/control-hull-dimension.scad @@ -0,0 +1,4 @@ +hull() { + circle(1); + echo(1); +} diff --git a/tests/regression/cgalpngtest/control-hull-dimension-expected.png b/tests/regression/cgalpngtest/control-hull-dimension-expected.png new file mode 100644 index 0000000..ceeaf54 Binary files /dev/null and b/tests/regression/cgalpngtest/control-hull-dimension-expected.png differ diff --git a/tests/regression/dumptest/control-hull-dimension-expected.txt b/tests/regression/dumptest/control-hull-dimension-expected.txt new file mode 100644 index 0000000..be2e4ee --- /dev/null +++ b/tests/regression/dumptest/control-hull-dimension-expected.txt @@ -0,0 +1,5 @@ + hull() { + circle($fn = 0, $fa = 12, $fs = 2, r = 1); + group(); + } + diff --git a/tests/regression/opencsgtest/control-hull-dimension-expected.png b/tests/regression/opencsgtest/control-hull-dimension-expected.png new file mode 100644 index 0000000..52d11c1 Binary files /dev/null and b/tests/regression/opencsgtest/control-hull-dimension-expected.png differ diff --git a/tests/regression/throwntogethertest/control-hull-dimension-expected.png b/tests/regression/throwntogethertest/control-hull-dimension-expected.png new file mode 100644 index 0000000..52d11c1 Binary files /dev/null and b/tests/regression/throwntogethertest/control-hull-dimension-expected.png differ -- cgit v0.10.1