From 396fea7ecd90af1bd5b06143aeeff05abb7e3c0a Mon Sep 17 00:00:00 2001 From: Brad Pitcher Date: Tue, 27 Sep 2011 22:42:23 -0700 Subject: fixes assertion error noticed in example 21 diff --git a/src/dxfdata.h b/src/dxfdata.h index bada031..79bfba9 100644 --- a/src/dxfdata.h +++ b/src/dxfdata.h @@ -30,7 +30,7 @@ public: } }; - std::vector points; + std::vector > points; std::vector paths; std::vector dims; -- cgit v0.10.1 From 78c3cad02388172bda96bab73c15a08d7f9a21cd Mon Sep 17 00:00:00 2001 From: Brad Pitcher Date: Tue, 27 Sep 2011 22:55:58 -0700 Subject: remove the unnecessary prefix diff --git a/src/dxfdata.h b/src/dxfdata.h index 79bfba9..d24541c 100644 --- a/src/dxfdata.h +++ b/src/dxfdata.h @@ -30,7 +30,7 @@ public: } }; - std::vector > points; + std::vector > points; std::vector paths; std::vector dims; -- cgit v0.10.1 From fcb0145cb82e3086032c9b9aca4c4fc1e0a25611 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 28 Sep 2011 22:29:58 +0200 Subject: Added expected files for include-tests diff --git a/tests/regression/cgalpngtest/include-tests-expected.png b/tests/regression/cgalpngtest/include-tests-expected.png new file mode 100644 index 0000000..99ebcc7 Binary files /dev/null and b/tests/regression/cgalpngtest/include-tests-expected.png differ diff --git a/tests/regression/opencsgtest/include-tests-expected.png b/tests/regression/opencsgtest/include-tests-expected.png new file mode 100644 index 0000000..62be03c Binary files /dev/null and b/tests/regression/opencsgtest/include-tests-expected.png differ -- cgit v0.10.1 From d33eae21e2e70435041d8267b26a3a4253d9c8af Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 28 Sep 2011 22:32:35 +0200 Subject: added highlight-and-background-modifier and child-background tests diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 509180e..b92ee22 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -243,6 +243,9 @@ add_cmdline_test(cgalpngtest png ${CGALPNGTEST_FILES}) # Add opencsg tests to CTest LIST(APPEND OPENCSGTEST_FILES ${CGALPNGTEST_FILES}) +LIST(APPEND OPENCSGTEST_FILES + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/highlight-and-background-modifier.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-background.scad) add_cmdline_test(opencsgtest png ${OPENCSGTEST_FILES}) # Add dxfexport tests to CTest -- cgit v0.10.1 From dd45e625ed4add36d718a022951270a864641843 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 28 Sep 2011 22:33:36 +0200 Subject: added expected file for highlight-and-background-modifier test diff --git a/tests/regression/opencsgtest/highlight-and-background-modifier-expected.png b/tests/regression/opencsgtest/highlight-and-background-modifier-expected.png new file mode 100644 index 0000000..72d03c3 Binary files /dev/null and b/tests/regression/opencsgtest/highlight-and-background-modifier-expected.png differ -- cgit v0.10.1 From 51155dc6918b6628c5b713ad80283790467e77b9 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 28 Sep 2011 22:33:51 +0200 Subject: cosmetics diff --git a/tests/opencsgtest.cc b/tests/opencsgtest.cc index 59501a0..40db2ed 100644 --- a/tests/opencsgtest.cc +++ b/tests/opencsgtest.cc @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Normalized CSG tree has %d elements\n", csgInfo.root_chain->polysets.size()); if (csgInfo.highlight_terms.size() > 0) { - cerr << "Compiling highlights (" << csgInfo.highlight_terms.size() << " CSG Trees)...\n"; + cerr << "Compiling highlights (" << csgInfo.highlight_terms.size() << " CSG Trees)...\n"; csgInfo.highlights_chain = new CSGChain(); for (unsigned int i = 0; i < csgInfo.highlight_terms.size(); i++) { -- cgit v0.10.1 From 2779e7dea95e16397c25d88b76634931b24e504c Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 28 Sep 2011 22:35:42 +0200 Subject: added highlight-and-background-modifier and child-background tests diff --git a/testdata/scad/features/child-background.scad b/testdata/scad/features/child-background.scad new file mode 100644 index 0000000..9923913 --- /dev/null +++ b/testdata/scad/features/child-background.scad @@ -0,0 +1,8 @@ +module transparent() { + %child(); +} + +difference() { + sphere(r=10); + transparent() cylinder(h=30, r=6, center=true); +} diff --git a/testdata/scad/features/highlight-and-background-modifier.scad b/testdata/scad/features/highlight-and-background-modifier.scad new file mode 100644 index 0000000..945d6b4 --- /dev/null +++ b/testdata/scad/features/highlight-and-background-modifier.scad @@ -0,0 +1,8 @@ +difference() { + sphere(r=10); + %#cylinder(h=30, r=6, center=true); +} +translate([13,0,0]) difference() { + sphere(r=10); + #%cylinder(h=30, r=6, center=true); +} -- cgit v0.10.1 From da08b50c03418110a74a6f2667be1d916b607b87 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Wed, 28 Sep 2011 23:06:19 +0200 Subject: Added note about problem with modifiers using the child() module, reported by nophead diff --git a/src/control.cc b/src/control.cc index 492b909..1f79254 100644 --- a/src/control.cc +++ b/src/control.cc @@ -91,6 +91,8 @@ void for_eval(AbstractNode &node, const ModuleInstantiation &inst, size_t l, AbstractNode *ControlModule::evaluate(const Context*, const ModuleInstantiation *inst) const { + AbstractNode *node = NULL; + if (type == CHILD) { size_t n = 0; @@ -102,17 +104,20 @@ AbstractNode *ControlModule::evaluate(const Context*, const ModuleInstantiation for (int i = Context::ctx_stack.size()-1; i >= 0; i--) { const Context *c = Context::ctx_stack[i]; if (c->inst_p) { - if (n < c->inst_p->children.size()) - return c->inst_p->children[n]->evaluate(c->inst_p->ctx); - return NULL; + if (n < c->inst_p->children.size()) { + node = c->inst_p->children[n]->evaluate(c->inst_p->ctx); + // FIXME: We'd like to inherit any tags from the ModuleInstantiation + // given as parameter to this method. However, the instantition which belongs + // to the returned node cannot be changed. This causes the test + // features/child-background.scad to fail. + } + return node; } c = c->parent; } return NULL; } - AbstractNode *node; - if (type == INT_FOR) node = new AbstractIntersectionNode(inst); else -- cgit v0.10.1