diff options
129 files changed, 3845 insertions, 303 deletions
diff --git a/examples/example012.scad b/examples/example012.scad index 677154a..78ff058 100644 --- a/examples/example012.scad +++ b/examples/example012.scad @@ -8,5 +8,5 @@ difference() sphere(20); translate([ -2.92, 0.5, +20 ]) rotate([180, 0, 180]) - import_stl("example012.stl", convexity = 5); + import("example012.stl", convexity = 5); } diff --git a/examples/example015.scad b/examples/example015.scad index b123496..e8ac3a6 100644 --- a/examples/example015.scad +++ b/examples/example015.scad @@ -19,7 +19,7 @@ module shape() rotate(-45) scale([ 0.7, 1.3 ]) circle(5); } - import_dxf(file = "example009.dxf", layer = "body", + import(file = "example009.dxf", layer = "body", convexity = 6, scale=2); } diff --git a/examples/example016.scad b/examples/example016.scad index d75fafb..4ea9655 100644 --- a/examples/example016.scad +++ b/examples/example016.scad @@ -21,7 +21,7 @@ module blk2() { module chop() { translate([ -14, 0, 0 ]) - import_stl(file = "example016.stl", convexity = 12); + import(file = "example016.stl", convexity = 12); } difference() { diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index 190d75a..ddb9771 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -262,7 +262,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const LinearExtrudeNode &node) if (v->modinst->tag_background) continue; CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v); if (N.dim != 2) { - PRINT("ERROR: rotate_extrude() is not defined for 3D child objects!"); + PRINT("ERROR: linear_extrude() is not defined for 3D child objects!"); } else { if (sum.empty()) sum = N.copy(); diff --git a/src/linearextrude.cc b/src/linearextrude.cc index 9c3557b..019f606 100644 --- a/src/linearextrude.cc +++ b/src/linearextrude.cc @@ -146,7 +146,7 @@ std::string LinearExtrudeNode::toString() const "file = \"" << this->filename << "\", " "cache = \"" << QFileInfo(QString::fromStdString(this->filename)) << "\", " "layer = \"" << this->layername << "\", " - "origin = [ " << this->origin_x << " " << this->origin_y << " ], " + "origin = [" << this->origin_x << ", " << this->origin_y << "], " "scale = " << this->scale << ", "; } stream << diff --git a/src/node.cc b/src/node.cc index 12a7ca4..a4d70be 100644 --- a/src/node.cc +++ b/src/node.cc @@ -78,7 +78,9 @@ std::string AbstractIntersectionNode::toString() const std::string AbstractIntersectionNode::name() const { - return "intersection_for"; + // We write intersection here since the module will have to be evaluated + // before we get here and it will not longer retain the intersection_for parameters + return "intersection"; } void AbstractNode::progress_prepare() @@ -38,7 +38,6 @@ public: /*! Should return a PolySet of the given geometry. Returns NULL if smth. goes wrong */ virtual class PolySet *evaluate_polyset(class PolySetEvaluator *) const { return NULL; } - // FIXME: Make return value a reference const std::vector<AbstractNode*> &getChildren() const { return this->children; } diff --git a/src/rotateextrude.cc b/src/rotateextrude.cc index 4d6de73..13e5db0 100644 --- a/src/rotateextrude.cc +++ b/src/rotateextrude.cc @@ -124,7 +124,7 @@ std::string RotateExtrudeNode::toString() const "file = \"" << this->filename << "\", " "cache = \"" << QFileInfo(QString::fromStdString(this->filename)) << "\", " "layer = \"" << this->layername << "\", " - "origin = [ " << std::dec << this->origin_x << " " << this->origin_y << " ], " + "origin = [" << std::dec << this->origin_x << ", " << this->origin_y << "], " "scale = " << this->scale << ", "; } stream << diff --git a/src/value.cc b/src/value.cc index 6685594..44a4b88 100644 --- a/src/value.cc +++ b/src/value.cc @@ -341,6 +341,7 @@ std::string Value::toString() const switch (this->type) { case STRING: + // FIXME: Escape special characters when outputting stream << '"' << this->text << '"'; break; case VECTOR: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3167792..88b828e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -183,6 +183,7 @@ include_directories(../src) add_definitions(-DOPENSCAD_VERSION=test -DOPENSCAD_YEAR=2011 -DOPENSCAD_MONTH=10) set(CORE_SOURCES + tests-common.cc ../src/mathc99.cc ../src/handle_dep.cc ../src/qhash.cc @@ -347,9 +348,9 @@ file(GLOB MINIMAL_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/*.scad) file(GLOB FEATURES_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/*.scad) file(GLOB BUGS_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/*.scad) file(GLOB SCAD_DXF_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/dxf/*.scad) +file(GLOB EXAMPLE_FILES ${CMAKE_SOURCE_DIR}/../examples/*.scad) -list(APPEND DUMPTEST_FILES ${MINIMAL_FILES} - ${CMAKE_SOURCE_DIR}/../examples/example001.scad) +list(APPEND DUMPTEST_FILES ${MINIMAL_FILES} ${FEATURES_FILES} ${EXAMPLE_FILES}) list(APPEND ECHO_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/echo.scad diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc index bb65fa0..02ee35e 100644 --- a/tests/cgalpngtest.cc +++ b/tests/cgalpngtest.cc @@ -25,6 +25,7 @@ */ #include "myqhash.h" +#include "tests-common.h" #include "openscad.h" #include "node.h" #include "module.h" @@ -41,7 +42,6 @@ #include "CGAL_renderer.h" #include "cgal.h" #include "OffscreenView.h" -#include "handle_dep.h" #include <QApplication> #include <QFile> @@ -133,28 +133,12 @@ int main(int argc, char **argv) AbstractModule *root_module; ModuleInstantiation root_inst; - QFileInfo fileInfo(filename); - handle_dep(filename); - FILE *fp = fopen(filename, "rt"); - if (!fp) { - fprintf(stderr, "Can't open input file `%s'!\n", filename); + root_module = parsefile(filename); + if (!root_module) { exit(1); - } else { - std::stringstream text; - char buffer[513]; - int ret; - while ((ret = fread(buffer, 1, 512, fp)) > 0) { - buffer[ret] = 0; - text << buffer; - } - fclose(fp); - text << commandline_commands; - root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); - if (!root_module) { - exit(1); - } } + QFileInfo fileInfo(filename); QDir::setCurrent(fileInfo.absolutePath()); AbstractNode::resetIndexCounter(); diff --git a/tests/cgaltest.cc b/tests/cgaltest.cc index 242b7b7..0cbd89a 100644 --- a/tests/cgaltest.cc +++ b/tests/cgaltest.cc @@ -25,8 +25,8 @@ */ #include "myqhash.h" +#include "tests-common.h" #include "openscad.h" -#include "handle_dep.h" #include "node.h" #include "module.h" #include "context.h" @@ -117,28 +117,12 @@ int main(int argc, char **argv) AbstractModule *root_module; ModuleInstantiation root_inst; - QFileInfo fileInfo(filename); - handle_dep(filename); - FILE *fp = fopen(filename, "rt"); - if (!fp) { - fprintf(stderr, "Can't open input file `%s'!\n", filename); + root_module = parsefile(filename); + if (!root_module) { exit(1); - } else { - std::stringstream text; - char buffer[513]; - int ret; - while ((ret = fread(buffer, 1, 512, fp)) > 0) { - buffer[ret] = 0; - text << buffer; - } - fclose(fp); - text << commandline_commands; - root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); - if (!root_module) { - exit(1); - } } + QFileInfo fileInfo(filename); QDir::setCurrent(fileInfo.absolutePath()); AbstractNode::resetIndexCounter(); diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc index 08002e2..5268b28 100644 --- a/tests/csgtermtest.cc +++ b/tests/csgtermtest.cc @@ -25,10 +25,10 @@ */ #include "myqhash.h" +#include "tests-common.h" #include "PolySetEvaluator.h" #include "CSGTermEvaluator.h" #include "openscad.h" -#include "handle_dep.h" #include "node.h" #include "module.h" #include "context.h" @@ -103,28 +103,12 @@ int main(int argc, char **argv) ModuleInstantiation root_inst; const AbstractNode *root_node; - QFileInfo fileInfo(filename); - handle_dep(filename); - FILE *fp = fopen(filename, "rt"); - if (!fp) { - fprintf(stderr, "Can't open input file `%s'!\n", filename); + root_module = parsefile(filename); + if (!root_module) { exit(1); - } else { - std::stringstream text; - char buffer[513]; - int ret; - while ((ret = fread(buffer, 1, 512, fp)) > 0) { - buffer[ret] = 0; - text << buffer; - } - fclose(fp); - text << commandline_commands; - root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); - if (!root_module) { - exit(1); - } } + QFileInfo fileInfo(filename); QDir::setCurrent(fileInfo.absolutePath()); AbstractNode::resetIndexCounter(); diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc index 8460a59..57e397e 100644 --- a/tests/csgtestcore.cc +++ b/tests/csgtestcore.cc @@ -1,9 +1,9 @@ // csg test core, used by throwntegether test and opencsg test #include "csgtestcore.h" +#include "tests-common.h" #include "system-gl.h" #include "openscad.h" -#include "handle_dep.h" #include "builtin.h" #include "context.h" #include "node.h" @@ -74,8 +74,8 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) exit(1); } - std::string filename(argv[1]); - std::string outfile(argv[2]); + const char *filename = argv[1]; + const char *outfilename = argv[2]; initialize_builtin_functions(); initialize_builtin_modules(); @@ -111,28 +111,12 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) AbstractModule *root_module; ModuleInstantiation root_inst; - QFileInfo fileInfo(filename.c_str()); - handle_dep(filename); - FILE *fp = fopen(filename.c_str(), "rt"); - if (!fp) { - fprintf(stderr, "Can't open input file `%s'!\n", filename.c_str()); + root_module = parsefile(filename); + if (!root_module) { exit(1); - } else { - std::stringstream text; - char buffer[513]; - int ret; - while ((ret = fread(buffer, 1, 512, fp)) > 0) { - buffer[ret] = 0; - text << buffer; - } - fclose(fp); - text << commandline_commands; - root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); - if (!root_module) { - exit(1); - } } + QFileInfo fileInfo(filename); QDir::setCurrent(fileInfo.absolutePath()); AbstractNode::resetIndexCounter(); @@ -231,7 +215,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) csgInfo.glview->paintGL(); - csgInfo.glview->save(outfile.c_str()); + csgInfo.glview->save(outfilename); destroy_builtin_functions(); destroy_builtin_modules(); diff --git a/tests/csgtexttest.cc b/tests/csgtexttest.cc index afa5bbe..ca28e37 100644 --- a/tests/csgtexttest.cc +++ b/tests/csgtexttest.cc @@ -24,10 +24,10 @@ * */ +#include "tests-common.h" #include "CSGTextRenderer.h" #include "CSGTextCache.h" #include "openscad.h" -#include "handle_dep.h" #include "node.h" #include "module.h" #include "context.h" @@ -106,28 +106,12 @@ int main(int argc, char **argv) ModuleInstantiation root_inst; AbstractNode *root_node; - QFileInfo fileInfo(filename); - handle_dep(filename); - FILE *fp = fopen(filename, "rt"); - if (!fp) { - fprintf(stderr, "Can't open input file `%s'!\n", filename); + root_module = parsefile(filename); + if (!root_module) { exit(1); - } else { - std::stringstream text; - char buffer[513]; - int ret; - while ((ret = fread(buffer, 1, 512, fp)) > 0) { - buffer[ret] = 0; - text << buffer; - } - fclose(fp); - text << commandline_commands; - root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); - if (!root_module) { - exit(1); - } } + QFileInfo fileInfo(filename); QDir::setCurrent(fileInfo.absolutePath()); AbstractNode::resetIndexCounter(); diff --git a/tests/dumptest.cc b/tests/dumptest.cc index 7344f95..d2fd9b1 100644 --- a/tests/dumptest.cc +++ b/tests/dumptest.cc @@ -24,15 +24,14 @@ * */ +#include "tests-common.h" #include "openscad.h" -#include "handle_dep.h" #include "node.h" #include "module.h" #include "context.h" #include "value.h" #include "export.h" #include "builtin.h" -#include "nodedumper.h" #include "Tree.h" #include <QApplication> @@ -54,28 +53,14 @@ QString currentdir; QString examplesdir; QString librarydir; -static AbstractModule *parsefile(const char *filename) +string dumptree(const Tree &tree, const AbstractNode &node) { - AbstractModule *root_module = NULL; - - QFileInfo fileInfo(filename); - handle_dep(filename); - FILE *fp = fopen(filename, "rt"); - if (!fp) { - fprintf(stderr, "Can't open input file `%s'!\n", filename); - } else { - std::stringstream text; - char buffer[513]; - int ret; - while ((ret = fread(buffer, 1, 512, fp)) > 0) { - buffer[ret] = 0; - text << buffer; - } - fclose(fp); - text << commandline_commands; - root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); + std::stringstream str; + const std::vector<AbstractNode*> &children = node.getChildren(); + for (std::vector<AbstractNode*>::const_iterator iter = children.begin(); iter != children.end(); iter++) { + str << tree.getString(**iter) << "\n"; } - return root_module; + return str.str(); } int main(int argc, char **argv) @@ -135,14 +120,15 @@ int main(int argc, char **argv) AbstractNode::resetIndexCounter(); root_node = root_module->evaluate(&root_ctx, &root_inst); - // Cache test - QString teststr("test"); Tree tree; tree.setRoot(root_node); - string dumpstdstr = tree.getString(*root_node); - string dumpstdstr_cached = tree.getString(*root_node); - assert(dumpstdstr == dumpstdstr_cached); + string dumpstdstr = dumptree(tree, *root_node); + string dumpstdstr_cached = dumptree(tree, *root_node); + if (dumpstdstr != dumpstdstr_cached) { + fprintf(stderr, "Error: Dump cached failed\n"); + exit(1); + } QDir::setCurrent(original_path.absolutePath()); std::ofstream outfile; @@ -150,10 +136,29 @@ int main(int argc, char **argv) outfile << dumpstdstr << "\n"; outfile.close(); - if (!parsefile(outfilename)) { + root_module = parsefile(outfilename); + if (!root_module) { fprintf(stderr, "Error: Unable to read back dumped file\n"); exit(1); } + fileInfo = QFileInfo(outfilename); + QDir::setCurrent(fileInfo.absolutePath()); + + AbstractNode::resetIndexCounter(); + root_node = root_module->evaluate(&root_ctx, &root_inst); + + tree.setRoot(root_node); + + string readbackstr = dumptree(tree, *root_node); + if (dumpstdstr != readbackstr) { + fprintf(stderr, "Error: Readback is different from original dump:\n"); + fprintf(stderr, "Original:\n"); + fprintf(stderr, dumpstdstr.c_str()); + fprintf(stderr, "Readback:\n"); + fprintf(stderr, readbackstr.c_str()); + exit(1); + } + destroy_builtin_functions(); destroy_builtin_modules(); diff --git a/tests/echotest.cc b/tests/echotest.cc index 329aac2..d1d1f9b 100644 --- a/tests/echotest.cc +++ b/tests/echotest.cc @@ -24,8 +24,8 @@ * */ +#include "tests-common.h" #include "openscad.h" -#include "handle_dep.h" #include "node.h" #include "module.h" #include "context.h" @@ -110,28 +110,12 @@ int main(int argc, char **argv) ModuleInstantiation root_inst; AbstractNode *root_node; - QFileInfo fileInfo(filename); - handle_dep(filename); - FILE *fp = fopen(filename, "rt"); - if (!fp) { - fprintf(stderr, "Can't open input file `%s'!\n", filename); + root_module = parsefile(filename); + if (!root_module) { exit(1); - } else { - std::stringstream text; - char buffer[513]; - int ret; - while ((ret = fread(buffer, 1, 512, fp)) > 0) { - buffer[ret] = 0; - text << buffer; - } - fclose(fp); - text << commandline_commands; - root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); - if (!root_module) { - exit(1); - } } + QFileInfo fileInfo(filename); QDir::setCurrent(fileInfo.absolutePath()); AbstractNode::resetIndexCounter(); diff --git a/tests/regression/csgtexttest/allmodules-expected.txt b/tests/regression/csgtexttest/allmodules-expected.txt index 34fa5ae..49171ba 100644 --- a/tests/regression/csgtexttest/allmodules-expected.txt +++ b/tests/regression/csgtexttest/allmodules-expected.txt @@ -1 +1 @@ -group1(minkowski2+glide3+subdiv4+hull5+group6+group6+group6+intersection_for9+group6+union11+difference12+intersection13+linear_extrude+linear_extrude+rotate_extrude+rotate_extrude+import+import+import+import+group6+cube+sphere+cylinder+polyhedron+square+circle+polygon+projection+render31+surface+transform33+transform33+transform35+transform33+transform33+color38) +group1(minkowski2+glide3+subdiv4+hull5+group6+group6+group6+intersection9+group6+union11+difference12+intersection9+linear_extrude+linear_extrude+rotate_extrude+rotate_extrude+import+import+import+import+group6+cube+sphere+cylinder+polyhedron+square+circle+polygon+projection+render31+surface+transform33+transform33+transform35+transform33+transform33+color38) diff --git a/tests/regression/csgtexttest/intersection_for-expected.txt b/tests/regression/csgtexttest/intersection_for-expected.txt index b503644..0ce0967 100644 --- a/tests/regression/csgtexttest/intersection_for-expected.txt +++ b/tests/regression/csgtexttest/intersection_for-expected.txt @@ -1 +1 @@ -group1(intersection_for2) +group1(intersection2) diff --git a/tests/regression/dumptest/2d-3d-expected.txt b/tests/regression/dumptest/2d-3d-expected.txt new file mode 100644 index 0000000..5789ed7 --- /dev/null +++ b/tests/regression/dumptest/2d-3d-expected.txt @@ -0,0 +1,5 @@ + cube(size = [1, 1, 1], center = false); + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [1, 1], center = false); + } + diff --git a/tests/regression/dumptest/allfunctions-expected.txt b/tests/regression/dumptest/allfunctions-expected.txt index 0a04719..8b13789 100644 --- a/tests/regression/dumptest/allfunctions-expected.txt +++ b/tests/regression/dumptest/allfunctions-expected.txt @@ -1 +1 @@ -group(); + diff --git a/tests/regression/dumptest/allmodules-expected.txt b/tests/regression/dumptest/allmodules-expected.txt index 855b0e8..fee83a0 100644 --- a/tests/regression/dumptest/allmodules-expected.txt +++ b/tests/regression/dumptest/allmodules-expected.txt @@ -1,4 +1,3 @@ -group() { minkowski(convexity = 0); glide(path = undef, convexity = 0); subdiv(level = 1, convexity = 0); @@ -6,7 +5,7 @@ group() { group(); group(); group(); - intersection_for(); + intersection(); group(); union(); difference(); @@ -36,4 +35,4 @@ group() { multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); color([-1, -1, -1, 1]); -} + diff --git a/tests/regression/dumptest/assign-expected.txt b/tests/regression/dumptest/assign-expected.txt index 434cc8f..b2915cb 100644 --- a/tests/regression/dumptest/assign-expected.txt +++ b/tests/regression/dumptest/assign-expected.txt @@ -1,3 +1,2 @@ -group() { group(); -} + diff --git a/tests/regression/dumptest/assign-tests-expected.txt b/tests/regression/dumptest/assign-tests-expected.txt new file mode 100644 index 0000000..f9db497 --- /dev/null +++ b/tests/regression/dumptest/assign-tests-expected.txt @@ -0,0 +1,51 @@ + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [0, 0, 0], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [0, 0, 0], center = false); + } + } + } + multmatrix([[1, 0, 0, 0.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [1, 1, 1], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [0.5, 0.5, 0.5], center = false); + } + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [2, 2, 2], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [1, 1, 1], center = false); + } + } + } + multmatrix([[1, 0, 0, 4.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [3, 3, 3], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [1.5, 1.5, 1.5], center = false); + } + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [4, 4, 4], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = false); + } + } + } + multmatrix([[1, 0, 0, 12.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [5, 5, 5], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2.5, 2.5, 2.5], center = false); + } + } + } + } + diff --git a/tests/regression/dumptest/background-modifier-expected.txt b/tests/regression/dumptest/background-modifier-expected.txt new file mode 100644 index 0000000..ca75e52 --- /dev/null +++ b/tests/regression/dumptest/background-modifier-expected.txt @@ -0,0 +1,5 @@ + difference() { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 6, r2 = 6, center = true); + } + diff --git a/tests/regression/dumptest/child-background-expected.txt b/tests/regression/dumptest/child-background-expected.txt new file mode 100644 index 0000000..d720179 --- /dev/null +++ b/tests/regression/dumptest/child-background-expected.txt @@ -0,0 +1,7 @@ + difference() { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 6, r2 = 6, center = true); + } + } + diff --git a/tests/regression/dumptest/child-expected.txt b/tests/regression/dumptest/child-expected.txt index 0a04719..8b13789 100644 --- a/tests/regression/dumptest/child-expected.txt +++ b/tests/regression/dumptest/child-expected.txt @@ -1 +1 @@ -group(); + diff --git a/tests/regression/dumptest/child-tests-expected.txt b/tests/regression/dumptest/child-tests-expected.txt new file mode 100644 index 0000000..981a5c1 --- /dev/null +++ b/tests/regression/dumptest/child-tests-expected.txt @@ -0,0 +1,40 @@ + group() { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 16, $fa = 12, $fs = 1, r = 1); + } + multmatrix([[1, 0, 0, 2.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 16, $fa = 12, $fs = 1, h = 2, r1 = 1, r2 = 1, center = true); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [2, 2, 2], center = true); + } + } + } + group() { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); + multmatrix([[1, 0, 0, 2.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); + multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 16, $fa = 12, $fs = 1, r = 1); + } + multmatrix([[1, 0, 0, 2.5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); + multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); + } + } + } + multmatrix([[1, 0, 0, 2.5], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 16, $fa = 12, $fs = 1, h = 2, r1 = 1, r2 = 1, center = true); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group(); + } + diff --git a/tests/regression/dumptest/circle-expected.txt b/tests/regression/dumptest/circle-expected.txt index 1060d3c..ce06391 100644 --- a/tests/regression/dumptest/circle-expected.txt +++ b/tests/regression/dumptest/circle-expected.txt @@ -1,3 +1,2 @@ -group() { circle($fn = 0, $fa = 12, $fs = 1, r = 1); -} + diff --git a/tests/regression/dumptest/circle-tests-expected.txt b/tests/regression/dumptest/circle-tests-expected.txt new file mode 100644 index 0000000..c19bb0c --- /dev/null +++ b/tests/regression/dumptest/circle-tests-expected.txt @@ -0,0 +1,29 @@ + circle($fn = 0, $fa = 12, $fs = 1, r = 1); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 1); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 0); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 4, $fa = 12, $fs = 1, r = 1); + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, -3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 8, $fa = 12, $fs = 1, r = 1); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, -3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 12, $fa = 12, $fs = 1, r = 1); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 20, $fs = 0.3, r = 1); + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, -6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 30, $fs = 0.3, r = 1); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, -6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 40, $fs = 0.3, r = 1); + } + diff --git a/tests/regression/dumptest/color-expected.txt b/tests/regression/dumptest/color-expected.txt index ef862fc..cead62d 100644 --- a/tests/regression/dumptest/color-expected.txt +++ b/tests/regression/dumptest/color-expected.txt @@ -1,3 +1,2 @@ -group() { color([-1, -1, -1, 1]); -} + diff --git a/tests/regression/dumptest/color-tests-expected.txt b/tests/regression/dumptest/color-tests-expected.txt new file mode 100644 index 0000000..1224e2d --- /dev/null +++ b/tests/regression/dumptest/color-tests-expected.txt @@ -0,0 +1,55 @@ + color([-1, -1, -1, 1]); + color([-1, -1, -1, 1]); + multmatrix([[1, 0, 0, 12], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + color([1, 0, 0, 1]) { + multmatrix([[1, 0, 0, 24], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.501961, 0, 0.501961, 1]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + } + color([0, 0, 1, 0.5]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + multmatrix([[1, 0, 0, 12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0, 1, 0.5]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + } + multmatrix([[1, 0, 0, 24], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.501961, 0, 0.2]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + } + multmatrix([[1, 0, 0, -12], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([-1, -1, -1, 1]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + } + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([-1, -1, -1, 0.5]) { + group() { + cube(size = [10, 10, 10], center = false); + } + } + } + diff --git a/tests/regression/dumptest/cube-expected.txt b/tests/regression/dumptest/cube-expected.txt index 91dc5fc..d1c5d32 100644 --- a/tests/regression/dumptest/cube-expected.txt +++ b/tests/regression/dumptest/cube-expected.txt @@ -1,3 +1,2 @@ -group() { cube(size = [1, 1, 1], center = false); -} + diff --git a/tests/regression/dumptest/cube-tests-expected.txt b/tests/regression/dumptest/cube-tests-expected.txt new file mode 100644 index 0000000..697c433 --- /dev/null +++ b/tests/regression/dumptest/cube-tests-expected.txt @@ -0,0 +1,12 @@ + cube(size = [1, 1, 1], center = false); + cube(size = [1, 1, 0], center = false); + cube(size = [1, 0, 1], center = false); + cube(size = [0, 1, 1], center = false); + cube(size = [0, 0, 0], center = false); + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [2, 3, 1], center = false); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [2, 4, 2], center = true); + } + diff --git a/tests/regression/dumptest/cylinder-expected.txt b/tests/regression/dumptest/cylinder-expected.txt index a26a533..b839db7 100644 --- a/tests/regression/dumptest/cylinder-expected.txt +++ b/tests/regression/dumptest/cylinder-expected.txt @@ -1,3 +1,2 @@ -group() { cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 1, r2 = 1, center = false); -} + diff --git a/tests/regression/dumptest/cylinder-tests-expected.txt b/tests/regression/dumptest/cylinder-tests-expected.txt new file mode 100644 index 0000000..5b25429 --- /dev/null +++ b/tests/regression/dumptest/cylinder-tests-expected.txt @@ -0,0 +1,32 @@ + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 1, r2 = 1, center = false); + multmatrix([[1, 0, 0, 1], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 0, r2 = 0, center = false); + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 0, r2 = 0, center = false); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 5, r2 = 5, center = false); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 5, r2 = 5, center = true); + } + multmatrix([[1, 0, 0, 11], [0, 1, 0, -11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 5, r1 = 5, r2 = 1, center = false); + } + multmatrix([[1, 0, 0, 11], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 5, r1 = 5, r2 = 0, center = false); + } + multmatrix([[1, 0, 0, 11], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 8, r1 = 5, r2 = 5, center = false); + } + multmatrix([[1, 0, 0, 22], [0, 1, 0, -11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 5, r1 = 0, r2 = 5, center = true); + } + multmatrix([[1, 0, 0, 22], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 5, r1 = 5, r2 = 0, center = false); + } + multmatrix([[1, 0, 0, 22], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 15, r1 = 5, r2 = 5, center = false); + } + diff --git a/tests/regression/dumptest/difference-expected.txt b/tests/regression/dumptest/difference-expected.txt index 09b977f..84a3635 100644 --- a/tests/regression/dumptest/difference-expected.txt +++ b/tests/regression/dumptest/difference-expected.txt @@ -1,3 +1,2 @@ -group() { difference(); -} + diff --git a/tests/regression/dumptest/difference-tests-expected.txt b/tests/regression/dumptest/difference-tests-expected.txt index bc59e45..bbdf3ea 100644 --- a/tests/regression/dumptest/difference-tests-expected.txt +++ b/tests/regression/dumptest/difference-tests-expected.txt @@ -1,6 +1,38 @@ -group() { + difference(); + difference(); difference() { - sphere($fn = 0, $fa = 12, $fs = 1, r = 3); - cube(size = [3, 3, 8], center = true); + cube(size = [10, 10, 10], center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 4, r2 = 4, center = true); } -} + multmatrix([[1, 0, 0, 12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + cube(size = [10, 10, 10], center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 4, r2 = 4, center = true); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + cube(size = [10, 10, 10], center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 11, r1 = 4, r2 = 4, center = true); + multmatrix([[2.22045e-16, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 2.22045e-16, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 11, r1 = 4, r2 = 4, center = true); + } + } + } + multmatrix([[1, 0, 0, 12], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + cube(size = [10, 10, 10], center = true); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 7], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 4, r1 = 4, r2 = 4, center = true); + } + } + } + multmatrix([[1, 0, 0, 24], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + cube(size = [10, 10, 10], center = true); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 6.99], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 4, r1 = 4, r2 = 4, center = true); + } + } + } + diff --git a/tests/regression/dumptest/dim-all-expected.txt b/tests/regression/dumptest/dim-all-expected.txt index 8d088d9..98a9bd9 100644 --- a/tests/regression/dumptest/dim-all-expected.txt +++ b/tests/regression/dumptest/dim-all-expected.txt @@ -1,4 +1,3 @@ -group() { group(); group(); group(); @@ -7,4 +6,4 @@ group() { group(); group(); group(); -} + diff --git a/tests/regression/dumptest/disable-modifier-expected.txt b/tests/regression/dumptest/disable-modifier-expected.txt new file mode 100644 index 0000000..b1543f7 --- /dev/null +++ b/tests/regression/dumptest/disable-modifier-expected.txt @@ -0,0 +1,4 @@ + difference() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 6, r2 = 6, center = true); + } + diff --git a/tests/regression/dumptest/dxf-export-expected.txt b/tests/regression/dumptest/dxf-export-expected.txt index 692526c..93be68c 100644 --- a/tests/regression/dumptest/dxf-export-expected.txt +++ b/tests/regression/dumptest/dxf-export-expected.txt @@ -1,4 +1,3 @@ -group() { circle($fn = 0, $fa = 12, $fs = 1, r = 5); multmatrix([[1, 0, 0, 15], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { square(size = [10, 10], center = true); @@ -14,4 +13,4 @@ group() { } } } -} + diff --git a/tests/regression/dumptest/dxf_linear_extrude-expected.txt b/tests/regression/dumptest/dxf_linear_extrude-expected.txt index 9284114..c6034d9 100644 --- a/tests/regression/dumptest/dxf_linear_extrude-expected.txt +++ b/tests/regression/dumptest/dxf_linear_extrude-expected.txt @@ -1,3 +1,2 @@ -group() { linear_extrude(height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/dxf_rotate_extrude-expected.txt b/tests/regression/dumptest/dxf_rotate_extrude-expected.txt index e2f5832..9ab8f0f 100644 --- a/tests/regression/dumptest/dxf_rotate_extrude-expected.txt +++ b/tests/regression/dumptest/dxf_rotate_extrude-expected.txt @@ -1,3 +1,2 @@ -group() { rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/echo-expected.txt b/tests/regression/dumptest/echo-expected.txt index 434cc8f..b2915cb 100644 --- a/tests/regression/dumptest/echo-expected.txt +++ b/tests/regression/dumptest/echo-expected.txt @@ -1,3 +1,2 @@ -group() { group(); -} + diff --git a/tests/regression/dumptest/echo-tests-expected.txt b/tests/regression/dumptest/echo-tests-expected.txt new file mode 100644 index 0000000..98a9bd9 --- /dev/null +++ b/tests/regression/dumptest/echo-tests-expected.txt @@ -0,0 +1,9 @@ + group(); + group(); + group(); + group(); + group(); + group(); + group(); + group(); + diff --git a/tests/regression/dumptest/example001-expected.txt b/tests/regression/dumptest/example001-expected.txt index ab7e4e9..7d92377 100644 --- a/tests/regression/dumptest/example001-expected.txt +++ b/tests/regression/dumptest/example001-expected.txt @@ -1,4 +1,3 @@ -group() { group() { difference() { sphere($fn = 0, $fa = 12, $fs = 1, r = 25); @@ -19,4 +18,4 @@ group() { } } } -} + diff --git a/tests/regression/dumptest/example002-expected.txt b/tests/regression/dumptest/example002-expected.txt new file mode 100644 index 0000000..04fc3b9 --- /dev/null +++ b/tests/regression/dumptest/example002-expected.txt @@ -0,0 +1,21 @@ + group() { + intersection() { + difference() { + union() { + cube(size = [30, 30, 30], center = true); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + cube(size = [15, 15, 50], center = true); + } + } + union() { + cube(size = [50, 10, 10], center = true); + cube(size = [10, 50, 10], center = true); + cube(size = [10, 10, 50], center = true); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 5], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 50, r1 = 20, r2 = 5, center = true); + } + } + } + diff --git a/tests/regression/dumptest/example003-expected.txt b/tests/regression/dumptest/example003-expected.txt new file mode 100644 index 0000000..480b032 --- /dev/null +++ b/tests/regression/dumptest/example003-expected.txt @@ -0,0 +1,16 @@ + group() { + difference() { + union() { + cube(size = [30, 30, 30], center = true); + cube(size = [40, 15, 15], center = true); + cube(size = [15, 40, 15], center = true); + cube(size = [15, 15, 40], center = true); + } + union() { + cube(size = [50, 10, 10], center = true); + cube(size = [10, 50, 10], center = true); + cube(size = [10, 10, 50], center = true); + } + } + } + diff --git a/tests/regression/dumptest/example004-expected.txt b/tests/regression/dumptest/example004-expected.txt new file mode 100644 index 0000000..a85ed90 --- /dev/null +++ b/tests/regression/dumptest/example004-expected.txt @@ -0,0 +1,7 @@ + group() { + difference() { + cube(size = [30, 30, 30], center = true); + sphere($fn = 0, $fa = 12, $fs = 1, r = 20); + } + } + diff --git a/tests/regression/dumptest/example005-expected.txt b/tests/regression/dumptest/example005-expected.txt new file mode 100644 index 0000000..e584aa7 --- /dev/null +++ b/tests/regression/dumptest/example005-expected.txt @@ -0,0 +1,43 @@ + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -120], [0, 0, 0, 1]]) { + difference() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 50, r1 = 100, r2 = 100, center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 10], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 50, r1 = 80, r2 = 80, center = false); + } + multmatrix([[1, 0, 0, 100], [0, 1, 0, 0], [0, 0, 1, 35], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + } + group() { + group(); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 80], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 200, r1 = 10, r2 = 10, center = false); + } + group(); + multmatrix([[1, 0, 0, 69.282], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 200, r1 = 10, r2 = 10, center = false); + } + group(); + multmatrix([[1, 0, 0, 69.282], [0, 1, 0, -40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 200, r1 = 10, r2 = 10, center = false); + } + group(); + multmatrix([[1, 0, 0, 9.79717e-15], [0, 1, 0, -80], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 200, r1 = 10, r2 = 10, center = false); + } + group(); + multmatrix([[1, 0, 0, -69.282], [0, 1, 0, -40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 200, r1 = 10, r2 = 10, center = false); + } + group(); + multmatrix([[1, 0, 0, -69.282], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 200, r1 = 10, r2 = 10, center = false); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 200], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 120, r2 = 0, center = false); + } + } + } + diff --git a/tests/regression/dumptest/example006-expected.txt b/tests/regression/dumptest/example006-expected.txt new file mode 100644 index 0000000..467ccbc --- /dev/null +++ b/tests/regression/dumptest/example006-expected.txt @@ -0,0 +1,373 @@ + group() { + difference() { + cube(size = [100, 100, 100], center = true); + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, 50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1, -1.22465e-16, 0, 0], [1.22465e-16, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1.83697e-16, 1, 0, 0], [-1, -1.83697e-16, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, 50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1, -1.22465e-16, 0, 0], [1.22465e-16, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1.83697e-16, 1, 0, 0], [-1, -1.83697e-16, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + } + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, 50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1, -1.22465e-16, 0, 0], [1.22465e-16, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1.83697e-16, 1, 0, 0], [-1, -1.83697e-16, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, -40], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + } + } + } + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, -20], [0, 1, 0, 0], [0, 0, 1, -20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + multmatrix([[-1, -1.22465e-16, 0, 0], [1.22465e-16, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, -20], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -20], [0, 1, 0, 0], [0, 0, 1, 25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + multmatrix([[-1.83697e-16, 1, 0, 0], [-1, -1.83697e-16, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -25], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -25], [0, 1, 0, 0], [0, 0, 1, 25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, 25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, -25], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, 25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, 1, 0], [0, -1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + multmatrix([[1, 0, 0, -25], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, -25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, -25], [0, 1, 0, 0], [0, 0, 1, 25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, 25], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + } + } + } + } + } + diff --git a/tests/regression/dumptest/example007-expected.txt b/tests/regression/dumptest/example007-expected.txt new file mode 100644 index 0000000..9f6c9a9 --- /dev/null +++ b/tests/regression/dumptest/example007-expected.txt @@ -0,0 +1,46 @@ + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) { + group() { + difference() { + rotate_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example007.dxf", cache = "4d38d4de.3739", layer = "dorn", origin = [0, 0], scale = 1, convexity = 3, $fn = 0, $fa = 12, $fs = 1); + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + intersection() { + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example007.dxf", cache = "4d38d4de.3739", layer = "cutout1", origin = [0, 0], scale = 1, height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + } + multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example007.dxf", cache = "4d38d4de.3739", layer = "cutout2", origin = [0, 0], scale = 1, height = 100, center = false, convexity = 2, $fn = 0, $fa = 12, $fs = 1); + } + } + } + } + } + } + multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + intersection() { + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example007.dxf", cache = "4d38d4de.3739", layer = "cutout1", origin = [0, 0], scale = 1, height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + } + multmatrix([[6.12323e-17, -1, 0, 0], [1, 6.12323e-17, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -50], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example007.dxf", cache = "4d38d4de.3739", layer = "cutout2", origin = [0, 0], scale = 1, height = 100, center = false, convexity = 2, $fn = 0, $fa = 12, $fs = 1); + } + } + } + } + } + } + } + } + } + } + diff --git a/tests/regression/dumptest/example008-expected.txt b/tests/regression/dumptest/example008-expected.txt new file mode 100644 index 0000000..8620536 --- /dev/null +++ b/tests/regression/dumptest/example008-expected.txt @@ -0,0 +1,28 @@ + difference() { + intersection() { + multmatrix([[1, 0, 0, -25], [0, 1, 0, -25], [0, 0, 1, -25], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example008.dxf", cache = "4d38d4de.462c", layer = "G", origin = [0, 0], scale = 1, height = 50, center = false, convexity = 3, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -25], [0, 1, 0, -125], [0, 0, 1, -25], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example008.dxf", cache = "4d38d4de.462c", layer = "E", origin = [0, 0], scale = 1, height = 50, center = false, convexity = 3, $fn = 0, $fa = 12, $fs = 1); + } + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -125], [0, 1, 0, -125], [0, 0, 1, -25], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example008.dxf", cache = "4d38d4de.462c", layer = "B", origin = [0, 0], scale = 1, height = 50, center = false, convexity = 3, $fn = 0, $fa = 12, $fs = 1); + } + } + } + intersection() { + multmatrix([[1, 0, 0, -125], [0, 1, 0, -25], [0, 0, 1, -25], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example008.dxf", cache = "4d38d4de.462c", layer = "X", origin = [0, 0], scale = 1, height = 50, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -125], [0, 1, 0, -25], [0, 0, 1, -25], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example008.dxf", cache = "4d38d4de.462c", layer = "X", origin = [0, 0], scale = 1, height = 50, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + } + } + } + diff --git a/tests/regression/dumptest/example009-expected.txt b/tests/regression/dumptest/example009-expected.txt new file mode 100644 index 0000000..01d9ebe --- /dev/null +++ b/tests/regression/dumptest/example009-expected.txt @@ -0,0 +1,14 @@ + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example009.dxf", cache = "4d38d4de.59bc", layer = "body", origin = [0, 0], scale = 1, height = 22, center = true, convexity = 10, $fn = 0, $fa = 12, $fs = 1); + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 12], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example009.dxf", cache = "4d38d4de.59bc", layer = "plate", origin = [0, 0], scale = 1, height = 2, center = true, convexity = 10, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -12], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example009.dxf", cache = "4d38d4de.59bc", layer = "plate", origin = [0, 0], scale = 1, height = 2, center = true, convexity = 10, $fn = 0, $fa = 12, $fs = 1); + } + } + intersection() { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example009.dxf", cache = "4d38d4de.59bc", layer = "fan_top", origin = [0, 0], scale = 1, height = 20, center = true, convexity = 10, twist = -57.5288, slices = 4, $fn = 0, $fa = 12, $fs = 1); + rotate_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example009.dxf", cache = "4d38d4de.59bc", layer = "fan_side", origin = [0, -40], scale = 1, convexity = 10, $fn = 0, $fa = 12, $fs = 1); + } + diff --git a/tests/regression/dumptest/example010-expected.txt b/tests/regression/dumptest/example010-expected.txt new file mode 100644 index 0000000..19c84bf --- /dev/null +++ b/tests/regression/dumptest/example010-expected.txt @@ -0,0 +1,7 @@ + intersection() { + surface(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example010.dat", center = true); + multmatrix([[0.707107, -0.707107, 0, 0], [0.707107, 0.707107, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + surface(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example010.dat", center = true); + } + } + diff --git a/tests/regression/dumptest/example011-expected.txt b/tests/regression/dumptest/example011-expected.txt new file mode 100644 index 0000000..de56dde --- /dev/null +++ b/tests/regression/dumptest/example011-expected.txt @@ -0,0 +1,2 @@ + polyhedron(points = [[10, 0, 0], [0, 10, 0], [-10, 0, 0], [0, -10, 0], [0, 0, 10]], triangles = [[0, 1, 2, 3], [4, 1, 0], [4, 2, 1], [4, 3, 2], [4, 0, 3]], convexity = 1); + diff --git a/tests/regression/dumptest/example012-expected.txt b/tests/regression/dumptest/example012-expected.txt new file mode 100644 index 0000000..698ad99 --- /dev/null +++ b/tests/regression/dumptest/example012-expected.txt @@ -0,0 +1,9 @@ + difference() { + sphere($fn = 0, $fa = 12, $fs = 1, r = 20); + multmatrix([[1, 0, 0, -2.92], [0, 1, 0, 0.5], [0, 0, 1, 20], [0, 0, 0, 1]]) { + multmatrix([[-1, 1.22465e-16, 1.49976e-32, 0], [1.22465e-16, 1, 1.22465e-16, 0], [0, 1.22465e-16, -1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example012.stl", cache = "4d38d4de.456f", layer = "", origin = [0, 0], scale = 1, convexity = 5, $fn = 0, $fa = 12, $fs = 1); + } + } + } + diff --git a/tests/regression/dumptest/example013-expected.txt b/tests/regression/dumptest/example013-expected.txt new file mode 100644 index 0000000..53d2e83 --- /dev/null +++ b/tests/regression/dumptest/example013-expected.txt @@ -0,0 +1,10 @@ + intersection() { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example013.dxf", cache = "4d38d4de.34bc", layer = "", origin = [0, 0], scale = 1, height = 100, center = true, convexity = 3, $fn = 0, $fa = 12, $fs = 1); + multmatrix([[2.22045e-16, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 2.22045e-16, 0], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example013.dxf", cache = "4d38d4de.34bc", layer = "", origin = [0, 0], scale = 1, height = 100, center = true, convexity = 3, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, 0], [0, 2.22045e-16, -1, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example013.dxf", cache = "4d38d4de.34bc", layer = "", origin = [0, 0], scale = 1, height = 100, center = true, convexity = 3, $fn = 0, $fa = 12, $fs = 1); + } + } + diff --git a/tests/regression/dumptest/example014-expected.txt b/tests/regression/dumptest/example014-expected.txt new file mode 100644 index 0000000..9a65acd --- /dev/null +++ b/tests/regression/dumptest/example014-expected.txt @@ -0,0 +1,15 @@ + intersection() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + multmatrix([[0.469846, 0.882564, 0.0180283, 0], [-0.813798, 0.44097, -0.378522, 0], [-0.34202, 0.163176, 0.925417, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + multmatrix([[0.417218, 0.668356, -0.615817, 0], [0.642459, -0.696172, -0.320299, 0], [-0.642788, -0.262003, -0.719846, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + multmatrix([[0.0190076, -0.601928, 0.798324, 0], [0.0292692, 0.798461, 0.601335, 0], [-0.999391, 0.0119363, 0.0327948, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + } + diff --git a/tests/regression/dumptest/example015-expected.txt b/tests/regression/dumptest/example015-expected.txt new file mode 100644 index 0000000..24a3bbd --- /dev/null +++ b/tests/regression/dumptest/example015-expected.txt @@ -0,0 +1,29 @@ + group() { + difference() { + multmatrix([[1, 0, 0, -35], [0, 1, 0, -35], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + union() { + difference() { + square(size = [100, 100], center = true); + square(size = [50, 50], center = true); + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [15, 15], center = true); + } + } + multmatrix([[0.707107, -0.707107, 0, 0], [0.707107, 0.707107, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -15], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [100, 30], center = false); + } + } + } + } + multmatrix([[0.707107, 0.707107, 0, 0], [-0.707107, 0.707107, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[0.7, 0, 0, 0], [0, 1.3, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 5); + } + } + } + import(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example009.dxf", cache = "4d38d4de.59bc", layer = "body", origin = [0, 0], scale = 2, convexity = 6, $fn = 0, $fa = 12, $fs = 1); + } + diff --git a/tests/regression/dumptest/example016-expected.txt b/tests/regression/dumptest/example016-expected.txt new file mode 100644 index 0000000..d393fb6 --- /dev/null +++ b/tests/regression/dumptest/example016-expected.txt @@ -0,0 +1,84 @@ + difference() { + group() { + cube(size = [65, 28, 28], center = true); + } + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + render(convexity = 12) { + difference() { + group() { + difference() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 7.5], [0, 0, 0, 1]]) { + cube(size = [60, 28, 14], center = true); + } + cube(size = [8, 32, 32], center = true); + } + } + group() { + multmatrix([[1, 0, 0, -14], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example016.stl", cache = "4d38d4de.1954", layer = "", origin = [0, 0], scale = 1, convexity = 12, $fn = 0, $fa = 12, $fs = 1); + } + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + render(convexity = 12) { + difference() { + group() { + difference() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 7.5], [0, 0, 0, 1]]) { + cube(size = [60, 28, 14], center = true); + } + cube(size = [8, 32, 32], center = true); + } + } + group() { + multmatrix([[1, 0, 0, -14], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example016.stl", cache = "4d38d4de.1954", layer = "", origin = [0, 0], scale = 1, convexity = 12, $fn = 0, $fa = 12, $fs = 1); + } + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, -1, -1.22465e-16, 0], [0, 1.22465e-16, -1, 0], [0, 0, 0, 1]]) { + render(convexity = 12) { + difference() { + group() { + difference() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 7.5], [0, 0, 0, 1]]) { + cube(size = [60, 28, 14], center = true); + } + cube(size = [8, 32, 32], center = true); + } + } + group() { + multmatrix([[1, 0, 0, -14], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example016.stl", cache = "4d38d4de.1954", layer = "", origin = [0, 0], scale = 1, convexity = 12, $fn = 0, $fa = 12, $fs = 1); + } + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, -1.83697e-16, 1, 0], [0, -1, -1.83697e-16, 0], [0, 0, 0, 1]]) { + render(convexity = 12) { + difference() { + group() { + difference() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 7.5], [0, 0, 0, 1]]) { + cube(size = [60, 28, 14], center = true); + } + cube(size = [8, 32, 32], center = true); + } + } + group() { + multmatrix([[1, 0, 0, -14], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/examples/example016.stl", cache = "4d38d4de.1954", layer = "", origin = [0, 0], scale = 1, convexity = 12, $fn = 0, $fa = 12, $fs = 1); + } + } + } + } + } + } + } + diff --git a/tests/regression/dumptest/example017-expected.txt b/tests/regression/dumptest/example017-expected.txt new file mode 100644 index 0000000..42ef321 --- /dev/null +++ b/tests/regression/dumptest/example017-expected.txt @@ -0,0 +1,215 @@ + group(); + group(); + group() { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 74], [0, 0, 0, 1]]) { + linear_extrude(height = 6, center = false, convexity = 4, $fn = 0, $fa = 12, $fs = 1) { + group() { + difference() { + circle($fn = 0, $fa = 12, $fs = 1, r = 47); + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 36], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [6, 10], center = true); + } + } + multmatrix([[-0.5, -0.866025, 0, 0], [0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 36], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [6, 10], center = true); + } + } + multmatrix([[-0.5, 0.866025, 0, 0], [-0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 36], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [6, 10], center = true); + } + } + } + circle($fn = 0, $fa = 12, $fs = 1, r = 25); + } + } + } + } + linear_extrude(height = 6, center = false, convexity = 4, $fn = 0, $fa = 12, $fs = 1) { + group() { + difference() { + circle($fn = 0, $fa = 12, $fs = 1, r = 102); + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 88.5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [6, 15], center = true); + } + } + multmatrix([[-0.5, -0.866025, 0, 0], [0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 88.5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [6, 15], center = true); + } + } + multmatrix([[-0.5, 0.866025, 0, 0], [-0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 88.5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [6, 15], center = true); + } + } + } + circle($fn = 0, $fa = 12, $fs = 1, r = 75); + } + } + } + color([0.7, 0.7, 1, 1]) { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 102], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[2.22045e-16, 2.22045e-16, -1, 0], [-1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + linear_extrude(height = 6, center = true, convexity = 10, $fn = 0, $fa = 12, $fs = 1) { + group() { + union() { + difference() { + polygon(points = [[0, 6], [6, 6], [6, 0], [21, 0], [21, 6], [27, 6], [27, 0], [77, 0], [83, 12], [77, 18], [77, 74], [71, 74], [71, 80], [61, 80], [61, 74], [55, 74], [55, 80], [49, 74], [49, 18], [43, 12], [6, 12]], paths = undef, convexity = 1); + multmatrix([[1, 0, 0, 43], [0, 1, 0, 18], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + multmatrix([[1, 0, 0, 83], [0, 1, 0, 18], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + } + multmatrix([[1, 0, 0, 77], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [9, 12], center = false); + } + multmatrix([[1, 0, 0, 86], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [12, 12], center = false); + } + } + } + multmatrix([[1, 0, 0, 55], [0, 1, 0, 74], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [12, 12], center = false); + } + } + } + } + } + } + } + } + } + multmatrix([[-0.5, -0.866025, 0, 0], [0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 102], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[2.22045e-16, 2.22045e-16, -1, 0], [-1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + linear_extrude(height = 6, center = true, convexity = 10, $fn = 0, $fa = 12, $fs = 1) { + group() { + union() { + difference() { + polygon(points = [[0, 6], [6, 6], [6, 0], [21, 0], [21, 6], [27, 6], [27, 0], [77, 0], [83, 12], [77, 18], [77, 74], [71, 74], [71, 80], [61, 80], [61, 74], [55, 74], [55, 80], [49, 74], [49, 18], [43, 12], [6, 12]], paths = undef, convexity = 1); + multmatrix([[1, 0, 0, 43], [0, 1, 0, 18], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + multmatrix([[1, 0, 0, 83], [0, 1, 0, 18], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + } + multmatrix([[1, 0, 0, 77], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [9, 12], center = false); + } + multmatrix([[1, 0, 0, 86], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [12, 12], center = false); + } + } + } + multmatrix([[1, 0, 0, 55], [0, 1, 0, 74], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [12, 12], center = false); + } + } + } + } + } + } + } + } + } + multmatrix([[-0.5, 0.866025, 0, 0], [-0.866025, -0.5, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 102], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[2.22045e-16, 2.22045e-16, -1, 0], [-1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + linear_extrude(height = 6, center = true, convexity = 10, $fn = 0, $fa = 12, $fs = 1) { + group() { + union() { + difference() { + polygon(points = [[0, 6], [6, 6], [6, 0], [21, 0], [21, 6], [27, 6], [27, 0], [77, 0], [83, 12], [77, 18], [77, 74], [71, 74], [71, 80], [61, 80], [61, 74], [55, 74], [55, 80], [49, 74], [49, 18], [43, 12], [6, 12]], paths = undef, convexity = 1); + multmatrix([[1, 0, 0, 43], [0, 1, 0, 18], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + multmatrix([[1, 0, 0, 83], [0, 1, 0, 18], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + } + multmatrix([[1, 0, 0, 77], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [9, 12], center = false); + } + multmatrix([[1, 0, 0, 86], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [12, 12], center = false); + } + } + } + multmatrix([[1, 0, 0, 55], [0, 1, 0, 74], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + circle($fn = 0, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [12, 12], center = false); + } + } + } + } + } + } + } + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 12], [0, 0, 0, 1]]) { + group() { + rotate_extrude(convexity = 2, $fn = 0, $fa = 12, $fs = 1) { + square(size = [25, 68], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 68], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + square(size = [25, 25], center = false); + multmatrix([[1, 0, 0, 0], [0, 0.7, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 25); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 93], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -12.5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [12.5, 25], center = false); + } + circle($fn = 0, $fa = 12, $fs = 1, r = 12.5); + } + } + } + } + } + } + } + diff --git a/tests/regression/dumptest/example018-expected.txt b/tests/regression/dumptest/example018-expected.txt new file mode 100644 index 0000000..d83440a --- /dev/null +++ b/tests/regression/dumptest/example018-expected.txt @@ -0,0 +1,119 @@ + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, -150], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + multmatrix([[1, 0, 0, -150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [60, 60, 60], center = true); + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 50, r1 = 30, r2 = 30, center = true); + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [45, 45, 45], center = true); + multmatrix([[1, 0, 0, 0], [0, 0.707107, -0.707107, 0], [0, 0.707107, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, 0, 0.707107, 0], [0, 1, 0, 0], [-0.707107, 0, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, -0.707107, 0, 0], [0.707107, 0.707107, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + } + } + multmatrix([[1, 0, 0, 150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 30); + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + multmatrix([[1, 0, 0, -150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 50, r1 = 30, r2 = 30, center = true); + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [45, 45, 45], center = true); + multmatrix([[1, 0, 0, 0], [0, 0.707107, -0.707107, 0], [0, 0.707107, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, 0, 0.707107, 0], [0, 1, 0, 0], [-0.707107, 0, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, -0.707107, 0, 0], [0.707107, 0.707107, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + } + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 30); + } + multmatrix([[1, 0, 0, 150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [60, 60, 60], center = true); + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + multmatrix([[1, 0, 0, -150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [45, 45, 45], center = true); + multmatrix([[1, 0, 0, 0], [0, 0.707107, -0.707107, 0], [0, 0.707107, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, 0, 0.707107, 0], [0, 1, 0, 0], [-0.707107, 0, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, -0.707107, 0, 0], [0.707107, 0.707107, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 30); + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [60, 60, 60], center = true); + } + multmatrix([[1, 0, 0, 150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 50, r1 = 30, r2 = 30, center = true); + } + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 150], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + multmatrix([[1, 0, 0, -150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 30); + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [60, 60, 60], center = true); + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 50, r1 = 30, r2 = 30, center = true); + } + multmatrix([[1, 0, 0, 150], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [45, 45, 45], center = true); + multmatrix([[1, 0, 0, 0], [0, 0.707107, -0.707107, 0], [0, 0.707107, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, 0, 0.707107, 0], [0, 1, 0, 0], [-0.707107, 0, 0.707107, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + multmatrix([[0.707107, -0.707107, 0, 0], [0.707107, 0.707107, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [50, 50, 50], center = true); + } + } + } + } + } + } + } + diff --git a/tests/regression/dumptest/example019-expected.txt b/tests/regression/dumptest/example019-expected.txt new file mode 100644 index 0000000..2ad2fb6 --- /dev/null +++ b/tests/regression/dumptest/example019-expected.txt @@ -0,0 +1,126 @@ + group() { + multmatrix([[1, 0, 0, -100], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 45, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -95], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 46.5, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -90], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 48, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -85], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 49.5, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -80], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 51, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -75], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 52.5, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -70], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 54, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -65], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 55.5, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -60], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 57, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -55], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 58.5, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 60, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -45], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 59, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -40], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 58, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -35], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 57, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -30], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 56, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -25], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 55, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -20], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 54, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -15], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 55.05, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 56.1, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, -5], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 57.15, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 58.2, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 59.25, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 60.3, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 15], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 61.35, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 62.4, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 63.45, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 64.5, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 35], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 65.55, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 40], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 66.6, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 45], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 67.65, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 68.7, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 55], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 69.75, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 60], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 70.8, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 65], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 71.85, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 70], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 72.9, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 75], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 73.95, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 80], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 75, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 85], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 70.0714, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 90], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 65.1429, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 95], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 60.2143, r1 = 6, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 100], [0, 1, 0, 0], [0, 0, 1, -30], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 55.2857, r1 = 6, r2 = 2, center = false); + } + } + diff --git a/tests/regression/dumptest/example020-expected.txt b/tests/regression/dumptest/example020-expected.txt new file mode 100644 index 0000000..733f1e1 --- /dev/null +++ b/tests/regression/dumptest/example020-expected.txt @@ -0,0 +1,232 @@ + multmatrix([[1, 0, 0, -30], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + linear_extrude(height = 100, center = false, convexity = 8, twist = 411.429, slices = 34, $fn = 0, $fa = 12, $fs = 1) { + difference() { + circle($fn = 0, $fa = 12, $fs = 1, r = 20); + group() { + group(); + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[40, 0], [20, 0], [14.62391868272735, 3.337814009344716], [13.51453301853629, 6.508256086763372], [15.6366296493606, 12.46979603717467], [31.27325929872119, 24.93959207434934]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[0.62349, -0.781831, 0, 0], [0.781831, 0.62349, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[40, 0], [20, 0], [14.62391868272735, 3.337814009344716], [13.51453301853629, 6.508256086763372], [15.6366296493606, 12.46979603717467], [31.27325929872119, 24.93959207434934]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.222521, -0.974928, 0, 0], [0.974928, -0.222521, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[40, 0], [20, 0], [14.62391868272735, 3.337814009344716], [13.51453301853629, 6.508256086763372], [15.6366296493606, 12.46979603717467], [31.27325929872119, 24.93959207434934]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.900969, -0.433884, 0, 0], [0.433884, -0.900969, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[40, 0], [20, 0], [14.62391868272735, 3.337814009344716], [13.51453301853629, 6.508256086763372], [15.6366296493606, 12.46979603717467], [31.27325929872119, 24.93959207434934]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.900969, 0.433884, 0, 0], [-0.433884, -0.900969, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[40, 0], [20, 0], [14.62391868272735, 3.337814009344716], [13.51453301853629, 6.508256086763372], [15.6366296493606, 12.46979603717467], [31.27325929872119, 24.93959207434934]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.222521, 0.974928, 0, 0], [-0.974928, -0.222521, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[40, 0], [20, 0], [14.62391868272735, 3.337814009344716], [13.51453301853629, 6.508256086763372], [15.6366296493606, 12.46979603717467], [31.27325929872119, 24.93959207434934]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[0.62349, 0.781831, 0, 0], [-0.781831, 0.62349, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[40, 0], [20, 0], [14.62391868272735, 3.337814009344716], [13.51453301853629, 6.508256086763372], [15.6366296493606, 12.46979603717467], [31.27325929872119, 24.93959207434934]], paths = undef, convexity = 1); + } + } + } + } + } + } + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + difference() { + cylinder($fn = 6, $fa = 12, $fs = 1, h = 20, r1 = 30, r2 = 30, center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) { + group() { + linear_extrude(height = 40, center = false, convexity = 3, twist = 164.571, slices = 13, $fn = 0, $fa = 12, $fs = 1) { + difference() { + circle($fn = 0, $fa = 12, $fs = 1, r = 21); + group() { + group(); + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[42, 0], [21, 0], [15.59884659490918, 3.56033494330103], [14.41550188643871, 6.94213982588093], [16.41846113182863, 13.0932858390334], [32.83692226365725, 26.18657167806681]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[0.62349, -0.781831, 0, 0], [0.781831, 0.62349, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[42, 0], [21, 0], [15.59884659490918, 3.56033494330103], [14.41550188643871, 6.94213982588093], [16.41846113182863, 13.0932858390334], [32.83692226365725, 26.18657167806681]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.222521, -0.974928, 0, 0], [0.974928, -0.222521, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[42, 0], [21, 0], [15.59884659490918, 3.56033494330103], [14.41550188643871, 6.94213982588093], [16.41846113182863, 13.0932858390334], [32.83692226365725, 26.18657167806681]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.900969, -0.433884, 0, 0], [0.433884, -0.900969, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[42, 0], [21, 0], [15.59884659490918, 3.56033494330103], [14.41550188643871, 6.94213982588093], [16.41846113182863, 13.0932858390334], [32.83692226365725, 26.18657167806681]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.900969, 0.433884, 0, 0], [-0.433884, -0.900969, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[42, 0], [21, 0], [15.59884659490918, 3.56033494330103], [14.41550188643871, 6.94213982588093], [16.41846113182863, 13.0932858390334], [32.83692226365725, 26.18657167806681]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[-0.222521, 0.974928, 0, 0], [-0.974928, -0.222521, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[42, 0], [21, 0], [15.59884659490918, 3.56033494330103], [14.41550188643871, 6.94213982588093], [16.41846113182863, 13.0932858390334], [32.83692226365725, 26.18657167806681]], paths = undef, convexity = 1); + } + } + group(); + group() { + multmatrix([[0.62349, 0.781831, 0, 0], [-0.781831, 0.62349, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[42, 0], [21, 0], [15.59884659490918, 3.56033494330103], [14.41550188643871, 6.94213982588093], [16.41846113182863, 13.0932858390334], [32.83692226365725, 26.18657167806681]], paths = undef, convexity = 1); + } + } + } + } + } + } + } + } + } + } + group() { + linear_extrude(height = 100, center = false, convexity = 5, twist = 1500, slices = 79, $fn = 19.2, $fa = 12, $fs = 1) { + group() { + group() { + group() { + polygon(points = [[100, 0], [90.10870717256485, 30.58778441039996], [99.27731872645629, 33.70010865023236]], paths = undef, convexity = 1); + } + group(); + group(); + } + group() { + group(); + group(); + group() { + polygon(points = [[99.27731872645629, 33.70010865023236], [90.10870717256485, 30.58778441039996], [74.08779492859099, 56.84956452855862], [84.58287312965604, 64.90272127318551]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[84.58287312965604, 64.90272127318551], [74.08779492859099, 56.84956452855862], [51.22010456048879, 76.65630364955641], [59.89394204343166, 89.63761881095262]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[59.89394204343166, 89.63761881095262], [51.22010456048879, 76.65630364955641], [23.64046582983194, 88.22741959152876], [28.12334319067221, 104.9577456662849]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[28.12334319067221, 104.9577456662849], [23.64046582983194, 88.22741959152876], [-5.934009687954409, 90.53549252778905], [-7.146616158074179, 109.0362921199316]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-7.146616158074179, 109.0362921199316], [-5.934009687954409, 90.53549252778905], [-34.56302683546026, 83.44252814283341], [-41.97365963755769, 101.3333783594239]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-41.97365963755769, 101.3333783594239], [-34.56302683546026, 83.44252814283341], [-59.39283755470954, 67.72455141159254], [-72.47632546530423, 82.64341008420294]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-72.47632546530423, 82.64341008420294], [-59.39283755470954, 67.72455141159254], [-77.94228634059948, 44.99999999999999], [-95.26279441628826, 54.99999999999999]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-95.26279441628826, 54.99999999999999], [-77.94228634059948, 44.99999999999999], [-88.34760075969918, 17.57343041942462], [-107.8094553209469, 21.444633983801]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-107.8094553209469, 21.444633983801], [-88.34760075969918, 17.57343041942462], [-89.54486254542182, -11.78880480022482], [-108.7441097293403, -14.31643364378545]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-108.7441097293403, -14.31643364378545], [-89.54486254542182, -11.78880480022482], [-81.37304131717875, -40.12874312782305], [-98.0015069893589, -48.32899491597725]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-98.0015069893589, -48.32899491597725], [-81.37304131717875, -40.12874312782305], [-64.58695376169682, -64.5869537616968], [-76.83440247561271, -76.83440247561269]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-76.83440247561271, -76.83440247561269], [-64.58695376169682, -64.5869537616968], [-40.77625404048524, -82.68606355865667], [-47.68148400331503, -96.68848474788098]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-47.68148400331503, -96.68848474788098], [-40.77625404048524, -82.68606355865667], [-12.18926961151899, -92.58669478281102], [-13.91596883249134, -105.7022774919511]], paths = undef, convexity = 1); + } + } + group() { + group(); + group(); + group() { + polygon(points = [[-13.91596883249134, -105.7022774919511], [-12.18926961151899, -92.58669478281102], [18.56455524139444, -93.33032171881419], [20.45350916183121, -102.8267343618319]], paths = undef, convexity = 1); + } + } + group() { + group(); + group() { + polygon(points = [[20.45350916183121, -102.8267343618319], [18.56455524139444, -93.33032171881419], [50, -86.60254037844386]], paths = undef, convexity = 1); + } + group(); + } + } + } + } + diff --git a/tests/regression/dumptest/example021-expected.txt b/tests/regression/dumptest/example021-expected.txt new file mode 100644 index 0000000..8122a9d --- /dev/null +++ b/tests/regression/dumptest/example021-expected.txt @@ -0,0 +1,267 @@ + multmatrix([[1, 0, 0, -30], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = false, convexity = 0) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 20], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -20], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 15], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -15], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 10], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 5], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -5], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -5], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 5], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 10], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -15], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 15], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + multmatrix([[0.933013, 0.0669873, -0.353553, 0], [0.0669873, 0.933013, 0.353553, 0], [0.353553, -0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -20], [0, 0, 0, 1]]) { + linear_extrude(height = 0.5, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = true, convexity = 0) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 20], [0, 0, 0, 1]]) { + multmatrix([[0.933013, 0.0669873, 0.353553, 0], [0.0669873, 0.933013, -0.353553, 0], [-0.353553, 0.353553, 0.866025, 0], [0, 0, 0, 1]]) { + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + } + } + } + } + } + group() { + difference() { + sphere($fn = 0, $fa = 30, $fs = 1, r = 25); + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + multmatrix([[1, 0, 0, 0], [0, 6.12323e-17, -1, 0], [0, 1, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + multmatrix([[6.12323e-17, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 6.12323e-17, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 30, $fs = 1, h = 62.5, r1 = 12.5, r2 = 6.25, center = true); + } + } + } + } + } + diff --git a/tests/regression/dumptest/example022-expected.txt b/tests/regression/dumptest/example022-expected.txt new file mode 100644 index 0000000..4f224be --- /dev/null +++ b/tests/regression/dumptest/example022-expected.txt @@ -0,0 +1,126 @@ + multmatrix([[1, 0, 0, -15], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + cube(size = [10, 30, 40], center = true); + cube(size = [20, 20, 40], center = true); + group() { + multmatrix([[1, 0, 0, -5], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 40, r1 = 5, r2 = 5, center = true); + } + multmatrix([[1, 0, 0, -5], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 40, r1 = 5, r2 = 5, center = true); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 40, r1 = 5, r2 = 5, center = true); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 40, r1 = 5, r2 = 5, center = true); + } + } + } + } + } + multmatrix([[1, 0, 0, 15], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + cube(size = [20, 20, 30], center = true); + cube(size = [10, 30, 30], center = true); + cube(size = [10, 20, 40], center = true); + group() { + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -5], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -5], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 5], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 5], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 5, r2 = 5, center = true); + } + } + } + group() { + multmatrix([[2.22045e-16, -2.22045e-16, 1, 0], [1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -10], [0, 1, 0, -15], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[2.22045e-16, -2.22045e-16, 1, 0], [1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -10], [0, 1, 0, 15], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[2.22045e-16, -2.22045e-16, 1, 0], [1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 10], [0, 1, 0, -15], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[2.22045e-16, -2.22045e-16, 1, 0], [1, 0, -2.22045e-16, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 10], [0, 1, 0, 15], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 5, r2 = 5, center = true); + } + } + } + group() { + multmatrix([[2.22045e-16, 1, 2.22045e-16, 0], [0, 2.22045e-16, -1, 0], [-1, 2.22045e-16, 0, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -15], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[2.22045e-16, 1, 2.22045e-16, 0], [0, 2.22045e-16, -1, 0], [-1, 2.22045e-16, 0, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, -15], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[2.22045e-16, 1, 2.22045e-16, 0], [0, 2.22045e-16, -1, 0], [-1, 2.22045e-16, 0, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 15], [0, 1, 0, -5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 5, r2 = 5, center = true); + } + } + multmatrix([[2.22045e-16, 1, 2.22045e-16, 0], [0, 2.22045e-16, -1, 0], [-1, 2.22045e-16, 0, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 15], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 5, r2 = 5, center = true); + } + } + } + } + group() { + multmatrix([[1, 0, 0, -5], [0, 1, 0, -10], [0, 0, 1, -15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, -5], [0, 1, 0, -10], [0, 0, 1, 15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, -5], [0, 1, 0, 10], [0, 0, 1, -15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, -5], [0, 1, 0, 10], [0, 0, 1, 15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, -10], [0, 0, 1, -15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, -10], [0, 0, 1, 15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 10], [0, 0, 1, -15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 10], [0, 0, 1, 15], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + } + } + } + } + } + diff --git a/tests/regression/dumptest/for-expected.txt b/tests/regression/dumptest/for-expected.txt index 434cc8f..b2915cb 100644 --- a/tests/regression/dumptest/for-expected.txt +++ b/tests/regression/dumptest/for-expected.txt @@ -1,3 +1,2 @@ -group() { group(); -} + diff --git a/tests/regression/dumptest/for-nested-tests-expected.txt b/tests/regression/dumptest/for-nested-tests-expected.txt new file mode 100644 index 0000000..24fd447 --- /dev/null +++ b/tests/regression/dumptest/for-nested-tests-expected.txt @@ -0,0 +1,111 @@ + group() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 5], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 5], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 5], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 5], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 10], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 10], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 5], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 5], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 10], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 10], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 5], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 5], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 10], [0, 0, 1, 20], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + multmatrix([[1, 0, 0, 30], [0, 1, 0, 10], [0, 0, 1, 30], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 3); + } + } + diff --git a/tests/regression/dumptest/for-tests-expected.txt b/tests/regression/dumptest/for-tests-expected.txt new file mode 100644 index 0000000..ce8953b --- /dev/null +++ b/tests/regression/dumptest/for-tests-expected.txt @@ -0,0 +1,114 @@ + group(); + group(); + multmatrix([[1, 0, 0, -10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group(); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 3, r2 = 3, center = false); + } + } + group() { + multmatrix([[1, 0, 0, -20], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 1, r2 = 1, center = false); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 2, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 3, r2 = 3, center = false); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 4, r2 = 4, center = false); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 5, r2 = 5, center = false); + } + } + group() { + multmatrix([[1, 0, 0, -20], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 1, r2 = 1, center = false); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 2, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 3, r2 = 3, center = false); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 4, r2 = 4, center = false); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 5, r2 = 5, center = false); + } + } + group() { + multmatrix([[1, 0, 0, -20], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 1, r2 = 1, center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 2, r1 = 0.5, r2 = 0.5, center = true); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 3, r2 = 3, center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 2, r1 = 1.5, r2 = 1.5, center = true); + } + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 5, r2 = 5, center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 2, r1 = 2.5, r2 = 2.5, center = true); + } + } + } + group() { + multmatrix([[1, 0, 0, -15], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [1, 6, 2], center = true); + } + multmatrix([[1, 0, 0, -13], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [1, 6.8, 2], center = true); + } + multmatrix([[1, 0, 0, -11], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [1, 7.6, 2], center = true); + } + multmatrix([[1, 0, 0, -9], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [1, 8.4, 2], center = true); + } + multmatrix([[1, 0, 0, -7], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [1, 9.2, 2], center = true); + } + } + group(); + group() { + multmatrix([[1, 0, 0, -20], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 1, r2 = 1, center = false); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 2, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 3, r2 = 3, center = false); + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 4, r2 = 4, center = false); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 5, r2 = 5, center = false); + } + } + group(); + group(); + group(); + group() { + multmatrix([[1, 0, 0, -20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 1, r2 = 1, center = false); + } + multmatrix([[1, 0, 0, -10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 2, r2 = 2, center = false); + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 5, r2 = 5, center = false); + } + } + diff --git a/tests/regression/dumptest/glide-expected.txt b/tests/regression/dumptest/glide-expected.txt index 67e40b8..74fbc08 100644 --- a/tests/regression/dumptest/glide-expected.txt +++ b/tests/regression/dumptest/glide-expected.txt @@ -1,3 +1,2 @@ -group() { glide(path = undef, convexity = 0); -} + diff --git a/tests/regression/dumptest/group-expected.txt b/tests/regression/dumptest/group-expected.txt index 434cc8f..b2915cb 100644 --- a/tests/regression/dumptest/group-expected.txt +++ b/tests/regression/dumptest/group-expected.txt @@ -1,3 +1,2 @@ -group() { group(); -} + diff --git a/tests/regression/dumptest/highlight-and-background-modifier-expected.txt b/tests/regression/dumptest/highlight-and-background-modifier-expected.txt new file mode 100644 index 0000000..16f7b2a --- /dev/null +++ b/tests/regression/dumptest/highlight-and-background-modifier-expected.txt @@ -0,0 +1,11 @@ + difference() { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 6, r2 = 6, center = true); + } + multmatrix([[1, 0, 0, 13], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 6, r2 = 6, center = true); + } + } + diff --git a/tests/regression/dumptest/highlight-modifier-expected.txt b/tests/regression/dumptest/highlight-modifier-expected.txt new file mode 100644 index 0000000..ca75e52 --- /dev/null +++ b/tests/regression/dumptest/highlight-modifier-expected.txt @@ -0,0 +1,5 @@ + difference() { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 6, r2 = 6, center = true); + } + diff --git a/tests/regression/dumptest/hull-expected.txt b/tests/regression/dumptest/hull-expected.txt index 6f777b0..3f27d2f 100644 --- a/tests/regression/dumptest/hull-expected.txt +++ b/tests/regression/dumptest/hull-expected.txt @@ -1,3 +1,2 @@ -group() { hull(); -} + diff --git a/tests/regression/dumptest/hull2-tests-expected.txt b/tests/regression/dumptest/hull2-tests-expected.txt new file mode 100644 index 0000000..87365a6 --- /dev/null +++ b/tests/regression/dumptest/hull2-tests-expected.txt @@ -0,0 +1,35 @@ + group() { + hull() { + multmatrix([[1, 0, 0, 15], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 10); + } + difference() { + circle($fn = 0, $fa = 12, $fs = 1, r = 10); + circle($fn = 0, $fa = 12, $fs = 1, r = 5); + } + } + } + multmatrix([[1, 0, 0, 40], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + hull() { + multmatrix([[1, 0, 0, 15], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 10); + } + circle($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + hull() { + multmatrix([[1, 0, 0, 15], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [2, 2], center = false); + } + multmatrix([[1, 0, 0, 15], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [2, 2], center = false); + } + square(size = [2, 2], center = false); + } + } + } + diff --git a/tests/regression/dumptest/hull3-tests-expected.txt b/tests/regression/dumptest/hull3-tests-expected.txt new file mode 100644 index 0000000..831aae2 --- /dev/null +++ b/tests/regression/dumptest/hull3-tests-expected.txt @@ -0,0 +1,26 @@ + multmatrix([[1, 0, 0, 0], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + hull() { + multmatrix([[1, 0, 0, 15], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 1, r2 = 1, center = false); + } + difference() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 10, r1 = 1, r2 = 1, center = false); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 5, r1 = 1, r2 = 1, center = false); + } + } + } + } + multmatrix([[1, 0, 0, 40], [0, 1, 0, 40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + hull() { + multmatrix([[1, 0, 0, 15], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 10, r2 = 10, center = false); + } + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 10, r2 = 10, center = false); + } + } + } + hull(); + hull(); + diff --git a/tests/regression/dumptest/if-expected.txt b/tests/regression/dumptest/if-expected.txt index 434cc8f..b2915cb 100644 --- a/tests/regression/dumptest/if-expected.txt +++ b/tests/regression/dumptest/if-expected.txt @@ -1,3 +1,2 @@ -group() { group(); -} + diff --git a/tests/regression/dumptest/ifelse-tests-expected.txt b/tests/regression/dumptest/ifelse-tests-expected.txt new file mode 100644 index 0000000..1b60002 --- /dev/null +++ b/tests/regression/dumptest/ifelse-tests-expected.txt @@ -0,0 +1,58 @@ + group() { + cube(size = [2, 2, 2], center = true); + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + cube(size = [2, 2, 2], center = true); + } + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + group() { + cube(size = [2, 2, 2], center = true); + } + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + multmatrix([[1, 0, 0, 12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + multmatrix([[1, 0, 0, 12], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + multmatrix([[1, 0, 0, 15], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cube(size = [2, 2, 2], center = true); + } + } + diff --git a/tests/regression/dumptest/import-expected.txt b/tests/regression/dumptest/import-expected.txt index bf37e1d..6482303 100644 --- a/tests/regression/dumptest/import-expected.txt +++ b/tests/regression/dumptest/import-expected.txt @@ -1,3 +1,2 @@ -group() { import(file = "", cache = "0.0", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/import_dxf-expected.txt b/tests/regression/dumptest/import_dxf-expected.txt index bf37e1d..6482303 100644 --- a/tests/regression/dumptest/import_dxf-expected.txt +++ b/tests/regression/dumptest/import_dxf-expected.txt @@ -1,3 +1,2 @@ -group() { import(file = "", cache = "0.0", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/import_dxf-tests-expected.txt b/tests/regression/dumptest/import_dxf-tests-expected.txt new file mode 100644 index 0000000..f17daf2 --- /dev/null +++ b/tests/regression/dumptest/import_dxf-tests-expected.txt @@ -0,0 +1,24 @@ + import(file = "", cache = "0.0", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + multmatrix([[1, 0, 0, -210], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/polygons.dxf", cache = "4d38d4de.308a", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, -210], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/polygons.dxf", cache = "4d38d4de.308a", layer = "", origin = [0, 110], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, -210], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/polygons.dxf", cache = "4d38d4de.308a", layer = "", origin = [110, 110], scale = 0.5, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/multiple-layers.dxf", cache = "4e823dda.3570", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + multmatrix([[1, 0, 0, -200], [0, 1, 0, 200], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/multiple-layers.dxf", cache = "4e823dda.3570", layer = "0", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 200], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/multiple-layers.dxf", cache = "4e823dda.3570", layer = "0", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, 200], [0, 1, 0, 200], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/multiple-layers.dxf", cache = "4e823dda.3570", layer = "noname", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 200], [0, 0, 1, 0], [0, 0, 0, 1]]) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/multiple-layers.dxf", cache = "4e823dda.3570", layer = "Layer with a pretty long name including \ "special" /'\\ characters", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + } + diff --git a/tests/regression/dumptest/import_off-expected.txt b/tests/regression/dumptest/import_off-expected.txt index bf37e1d..6482303 100644 --- a/tests/regression/dumptest/import_off-expected.txt +++ b/tests/regression/dumptest/import_off-expected.txt @@ -1,3 +1,2 @@ -group() { import(file = "", cache = "0.0", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/import_stl-expected.txt b/tests/regression/dumptest/import_stl-expected.txt index bf37e1d..6482303 100644 --- a/tests/regression/dumptest/import_stl-expected.txt +++ b/tests/regression/dumptest/import_stl-expected.txt @@ -1,3 +1,2 @@ -group() { import(file = "", cache = "0.0", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/import_stl-tests-expected.txt b/tests/regression/dumptest/import_stl-tests-expected.txt index bc27c6a..8c3a540 100644 --- a/tests/regression/dumptest/import_stl-tests-expected.txt +++ b/tests/regression/dumptest/import_stl-tests-expected.txt @@ -1,3 +1,2 @@ -group() { - import_stl(file = "/Users/kintel/code/metalab/checkout/OpenSCAD/openscad-visitor/testdata/scad/import.stl", cache = "4c34b4bc.2506", convexity = 1); -} + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/scad/features/import.stl", cache = "4e823ddd.2506", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + diff --git a/tests/regression/dumptest/include test6-expected.txt b/tests/regression/dumptest/include test6-expected.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/regression/dumptest/include test6-expected.txt @@ -0,0 +1 @@ + diff --git a/tests/regression/dumptest/include-test5-expected.txt b/tests/regression/dumptest/include-test5-expected.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/regression/dumptest/include-test5-expected.txt @@ -0,0 +1 @@ + diff --git a/tests/regression/dumptest/include-tests-expected.txt b/tests/regression/dumptest/include-tests-expected.txt new file mode 100644 index 0000000..33f9156 --- /dev/null +++ b/tests/regression/dumptest/include-tests-expected.txt @@ -0,0 +1,32 @@ + group() { + group() { + cube(size = [1, 1, 1], center = true); + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 0.7, r2 = 0.2, center = true); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, -2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 10, $fa = 12, $fs = 1, h = 1, r1 = 0.5, r2 = 0.5, center = true); + } + } + multmatrix([[1, 0, 0, -2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + sphere($fn = 8, $fa = 12, $fs = 1, r = 0.5); + } + } + multmatrix([[1, 0, 0, -2], [0, 1, 0, -2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + difference() { + cube(size = [1, 1, 1], center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 2, r1 = 0.4, r2 = 0.4, center = true); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 16, $fa = 12, $fs = 1, r = 0.7); + } + } + diff --git a/tests/regression/dumptest/intersection-expected.txt b/tests/regression/dumptest/intersection-expected.txt index 409e196..ed3847d 100644 --- a/tests/regression/dumptest/intersection-expected.txt +++ b/tests/regression/dumptest/intersection-expected.txt @@ -1,3 +1,2 @@ -group() { intersection(); -} + diff --git a/tests/regression/dumptest/intersection-tests-expected.txt b/tests/regression/dumptest/intersection-tests-expected.txt index 90349a3..5613abf 100644 --- a/tests/regression/dumptest/intersection-tests-expected.txt +++ b/tests/regression/dumptest/intersection-tests-expected.txt @@ -1,6 +1,56 @@ -group() { + intersection(); + intersection(); intersection() { - sphere($fn = 0, $fa = 12, $fs = 1, r = 3); - cube(size = [3, 3, 8], center = true); + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 3], [0, 0, 0, 1]]) { + cube(size = [4, 4, 6], center = true); + } } -} + multmatrix([[1, 0, 0, 0], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + cube(size = [10, 10, 10], center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 12, r1 = 4, r2 = 4, center = true); + } + } + multmatrix([[1, 0, 0, 12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + cube(size = [10, 10, 10], center = true); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 12, r1 = 4, r2 = 4, center = true); + multmatrix([[2.22045e-16, 0, 1, 0], [0, 1, 0, 0], [-1, 0, 2.22045e-16, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 12, r1 = 4, r2 = 4, center = true); + } + } + } + multmatrix([[1, 0, 0, 12], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + cube(size = [10, 10, 10], center = true); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 7], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 4, r1 = 4, r2 = 4, center = true); + } + } + } + multmatrix([[1, 0, 0, 24], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + cube(size = [10, 10, 10], center = true); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 6.99], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 4, r1 = 4, r2 = 4, center = true); + } + } + } + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + cube(size = [10, 10, 10], center = true); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -10], [0, 0, 1, -10], [0, 0, 0, 1]]) { + cube(size = [10, 10, 10], center = true); + } + } + } + multmatrix([[1, 0, 0, -12], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + intersection() { + cube(size = [10, 10, 10], center = true); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -9.99], [0, 0, 1, -9.99], [0, 0, 0, 1]]) { + cube(size = [10, 10, 10], center = true); + } + } + } + diff --git a/tests/regression/dumptest/intersection_for-expected.txt b/tests/regression/dumptest/intersection_for-expected.txt index 8bb5d2d..ed3847d 100644 --- a/tests/regression/dumptest/intersection_for-expected.txt +++ b/tests/regression/dumptest/intersection_for-expected.txt @@ -1,3 +1,2 @@ -group() { - intersection_for(); -} + intersection(); + diff --git a/tests/regression/dumptest/intersection_for-tests-expected.txt b/tests/regression/dumptest/intersection_for-tests-expected.txt new file mode 100644 index 0000000..30d0bd3 --- /dev/null +++ b/tests/regression/dumptest/intersection_for-tests-expected.txt @@ -0,0 +1,17 @@ + intersection(); + intersection(); + intersection() { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + multmatrix([[0.469846, 0.882564, 0.0180283, 0], [-0.813798, 0.44097, -0.378522, 0], [-0.34202, 0.163176, 0.925417, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + multmatrix([[0.417218, 0.668356, -0.615817, 0], [0.642459, -0.696172, -0.320299, 0], [-0.642788, -0.262003, -0.719846, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + multmatrix([[0.0190076, -0.601928, 0.798324, 0], [0.0292692, 0.798461, 0.601335, 0], [-0.999391, 0.0119363, 0.0327948, 0], [0, 0, 0, 1]]) { + cube(size = [100, 20, 20], center = true); + } + } + diff --git a/tests/regression/dumptest/linear_extrude-expected.txt b/tests/regression/dumptest/linear_extrude-expected.txt index 9284114..c6034d9 100644 --- a/tests/regression/dumptest/linear_extrude-expected.txt +++ b/tests/regression/dumptest/linear_extrude-expected.txt @@ -1,3 +1,2 @@ -group() { linear_extrude(height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/linear_extrude-tests-expected.txt b/tests/regression/dumptest/linear_extrude-tests-expected.txt index 8fe9928..08b9f3e 100644 --- a/tests/regression/dumptest/linear_extrude-tests-expected.txt +++ b/tests/regression/dumptest/linear_extrude-tests-expected.txt @@ -1,30 +1,32 @@ -group() { - linear_extrude(file = "", cache = "0.0", layer = "", height = 10, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1); + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1); + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + cube(size = [1, 1, 1], center = false); + } + linear_extrude(height = 10, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { square(size = [10, 10], center = false); } multmatrix([[1, 0, 0, 19], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { - linear_extrude(file = "", cache = "0.0", layer = "", height = 10, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { - circle($fn = 0, $fa = 12, $fs = 1, r = 5); + linear_extrude(height = 10, center = true, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + difference() { + circle($fn = 0, $fa = 12, $fs = 1, r = 5); + circle($fn = 0, $fa = 12, $fs = 1, r = 3); + } } } multmatrix([[1, 0, 0, 31.5], [0, 1, 0, 2.5], [0, 0, 1, 0], [0, 0, 0, 1]]) { - linear_extrude(file = "", cache = "0.0", layer = "", height = 10, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + linear_extrude(height = 10, center = false, convexity = 1, twist = -45, slices = 3, $fn = 0, $fa = 12, $fs = 1) { polygon(points = [[-5, -2.5], [5, -2.5], [0, 2.5]], paths = undef, convexity = 1); } } - multmatrix([[1, 0, 0, 0], [0, 1, 0, -12], [0, 0, 1, 0], [0, 0, 0, 1]]) { - linear_extrude(file = "", cache = "0.0", layer = "", height = 20, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, twist = 45, slices = 3, $fn = 0, $fa = 12, $fs = 1) { + multmatrix([[1, 0, 0, 0], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + linear_extrude(height = 20, center = false, convexity = 1, twist = 45, slices = 2, $fn = 0, $fa = 12, $fs = 1) { square(size = [10, 10], center = false); } } - multmatrix([[1, 0, 0, 19], [0, 1, 0, -7], [0, 0, 1, 0], [0, 0, 0, 1]]) { - linear_extrude(file = "", cache = "0.0", layer = "", height = 20, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, twist = 90, slices = 7, $fn = 0, $fa = 12, $fs = 1) { - circle($fn = 0, $fa = 12, $fs = 1, r = 5); - } - } - multmatrix([[1, 0, 0, 31.5], [0, 1, 0, -9.5], [0, 0, 1, 0], [0, 0, 0, 1]]) { - linear_extrude(file = "", cache = "0.0", layer = "", height = 20, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, twist = 180, slices = 15, $fn = 0, $fa = 12, $fs = 1) { - polygon(points = [[-5, -2.5], [5, -2.5], [0, 2.5]], paths = undef, convexity = 1); + multmatrix([[1, 0, 0, 19], [0, 1, 0, 20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + linear_extrude(height = 20, center = false, convexity = 1, twist = 45, slices = 10, $fn = 0, $fa = 12, $fs = 1) { + square(size = [10, 10], center = false); } } -} + diff --git a/tests/regression/dumptest/minkowski-expected.txt b/tests/regression/dumptest/minkowski-expected.txt index ecab5f3..799062f 100644 --- a/tests/regression/dumptest/minkowski-expected.txt +++ b/tests/regression/dumptest/minkowski-expected.txt @@ -1,3 +1,2 @@ -group() { minkowski(convexity = 0); -} + diff --git a/tests/regression/dumptest/minkowski2-tests-expected.txt b/tests/regression/dumptest/minkowski2-tests-expected.txt new file mode 100644 index 0000000..fe78b90 --- /dev/null +++ b/tests/regression/dumptest/minkowski2-tests-expected.txt @@ -0,0 +1,31 @@ + multmatrix([[1, 0, 0, -20], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + minkowski(convexity = 0) { + difference() { + square(size = [10, 10], center = true); + square(size = [8, 8], center = true); + } + circle($fn = 0, $fa = 12, $fs = 1, r = 2); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + minkowski(convexity = 0) { + difference() { + square(size = [10, 10], center = false); + square(size = [5, 5], center = false); + } + circle($fn = 0, $fa = 12, $fs = 1, r = 5); + } + } + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + minkowski(convexity = 0) { + square(size = [10, 10], center = false); + circle($fn = 0, $fa = 12, $fs = 1, r = 5); + } + } + } + diff --git a/tests/regression/dumptest/minkowski3-tests-expected.txt b/tests/regression/dumptest/minkowski3-tests-expected.txt new file mode 100644 index 0000000..0226beb --- /dev/null +++ b/tests/regression/dumptest/minkowski3-tests-expected.txt @@ -0,0 +1,33 @@ + multmatrix([[1, 0, 0, -20], [0, 1, 0, 30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + minkowski(convexity = 0) { + difference() { + cube(size = [10, 10, 5], center = true); + cube(size = [8, 8, 10], center = true); + } + cylinder($fn = 0, $fa = 12, $fs = 1, h = 1, r1 = 2, r2 = 2, center = false); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 25], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + minkowski(convexity = 0) { + difference() { + cube(size = [10, 10, 5], center = false); + cube(size = [5, 5, 5], center = false); + } + cylinder($fn = 0, $fa = 12, $fs = 1, h = 5, r1 = 5, r2 = 5, center = false); + } + } + } + multmatrix([[1, 0, 0, 25], [0, 1, 0, 25], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + minkowski(convexity = 0) { + cube(size = [10, 10, 5], center = false); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 5, r1 = 5, r2 = 5, center = false); + } + } + } + minkowski(convexity = 0); + minkowski(convexity = 0); + diff --git a/tests/regression/dumptest/mirror-expected.txt b/tests/regression/dumptest/mirror-expected.txt index 3ad73cb..fdf0ee0 100644 --- a/tests/regression/dumptest/mirror-expected.txt +++ b/tests/regression/dumptest/mirror-expected.txt @@ -1,3 +1,2 @@ -group() { multmatrix([[-1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); -} + diff --git a/tests/regression/dumptest/multmatrix-expected.txt b/tests/regression/dumptest/multmatrix-expected.txt index 87e28e2..c3185a3 100644 --- a/tests/regression/dumptest/multmatrix-expected.txt +++ b/tests/regression/dumptest/multmatrix-expected.txt @@ -1,3 +1,2 @@ -group() { multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); -} + diff --git a/tests/regression/dumptest/null-polygons-expected.txt b/tests/regression/dumptest/null-polygons-expected.txt index bfceaff..f98d284 100644 --- a/tests/regression/dumptest/null-polygons-expected.txt +++ b/tests/regression/dumptest/null-polygons-expected.txt @@ -1,6 +1,5 @@ -group() { - linear_extrude(file = "", cache = "0.0", layer = "", height = 100, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { - import_dxf(file = "/Users/kintel/code/metalab/checkout/OpenSCAD/openscad-visitor/testdata/scad/null-polygons.dxf", cache = "4c34b4bc.3124", layer = "", origin = [ 0 0 ], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + linear_extrude(height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + import(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/scad/features/null-polygons.dxf", cache = "4e823ddd.3124", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); } - linear_extrude(file = "/Users/kintel/code/metalab/checkout/OpenSCAD/openscad-visitor/testdata/scad/null-polygons.dxf", cache = "4c34b4bc.3124", layer = "", height = 100, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + linear_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/scad/features/null-polygons.dxf", cache = "4e823ddd.3124", layer = "", origin = [0, 0], scale = 1, height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + diff --git a/tests/regression/dumptest/polygon-expected.txt b/tests/regression/dumptest/polygon-expected.txt index d04aec9..a525d29 100644 --- a/tests/regression/dumptest/polygon-expected.txt +++ b/tests/regression/dumptest/polygon-expected.txt @@ -1,3 +1,2 @@ -group() { polygon(points = undef, paths = undef, convexity = 1); -} + diff --git a/tests/regression/dumptest/polygon-tests-expected.txt b/tests/regression/dumptest/polygon-tests-expected.txt new file mode 100644 index 0000000..ce4ad87 --- /dev/null +++ b/tests/regression/dumptest/polygon-tests-expected.txt @@ -0,0 +1,32 @@ + polygon(points = undef, paths = undef, convexity = 1); + polygon(points = [], paths = undef, convexity = 1); + polygon(points = [[], []], paths = undef, convexity = 1); + polygon(points = [[[]]], paths = undef, convexity = 1); + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [1, 0], [1, 1]], paths = undef, convexity = 1); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0]], paths = undef, convexity = 1); + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [1, 1]], paths = undef, convexity = 1); + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [1, 1], [2, 2]], paths = undef, convexity = 1); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [1, 0], [1, 1], [0, 1]], paths = undef, convexity = 1); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [1, 0], [1, 1], [0, 1]], paths = [], convexity = 1); + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, -2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [1, 0], [0.8, 0.5], [1, 1], [0, 1]], paths = undef, convexity = 1); + } + multmatrix([[1, 0, 0, -2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [0.5, -0.2], [1, 0], [1.2, 0.5], [1, 1], [0.5, 1.2], [0, 1], [-0.2, 0.5]], paths = undef, convexity = 1); + } + multmatrix([[1, 0, 0, -2], [0, 1, 0, -2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polygon(points = [[0, 0], [0.5, -0.2], [1, 0], [1.2, 0.5], [1, 1], [0.5, 1.2], [0, 1], [-0.2, 0.5]], paths = [[0, 1, 2, 3], [4, 5, 6, 7]], convexity = 1); + } + diff --git a/tests/regression/dumptest/polyhedron-expected.txt b/tests/regression/dumptest/polyhedron-expected.txt index c37a529..806c952 100644 --- a/tests/regression/dumptest/polyhedron-expected.txt +++ b/tests/regression/dumptest/polyhedron-expected.txt @@ -1,3 +1,2 @@ -group() { polyhedron(points = undef, triangles = undef, convexity = 1); -} + diff --git a/tests/regression/dumptest/polyhedron-tests-expected.txt b/tests/regression/dumptest/polyhedron-tests-expected.txt new file mode 100644 index 0000000..7de5236 --- /dev/null +++ b/tests/regression/dumptest/polyhedron-tests-expected.txt @@ -0,0 +1,26 @@ + group() { + polyhedron(points = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]], triangles = [[0, 4, 2], [0, 2, 5], [0, 3, 4], [0, 5, 3], [1, 2, 4], [1, 5, 2], [1, 4, 3], [1, 3, 5]], convexity = 1); + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polyhedron(points = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]], triangles = [[0, 4, 2], [0, 2, 5], [0, 3, 4], [0, 5, 3], [1, 2, 4], [1, 5, 2], [1, 3, 4], [1, 3, 5]], convexity = 1); + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polyhedron(points = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]], triangles = [[0, 2, 4], [0, 5, 2], [0, 4, 3], [0, 3, 5], [1, 4, 2], [1, 2, 5], [1, 3, 4], [1, 5, 3]], convexity = 1); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + group() { + polyhedron(points = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]], triangles = [[0, 4, 2], [0, 2, 5], [0, 3, 4], [0, 5, 3], [1, 2, 4], [1, 5, 2], [1, 4, 3], [1, 3, 5]], convexity = 1); + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polyhedron(points = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]], triangles = [[0, 4, 2], [0, 2, 5], [0, 3, 4], [0, 5, 3], [1, 2, 4], [1, 5, 2], [1, 3, 4], [1, 3, 5]], convexity = 1); + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + polyhedron(points = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]], triangles = [[0, 2, 4], [0, 5, 2], [0, 4, 3], [0, 3, 5], [1, 4, 2], [1, 2, 5], [1, 3, 4], [1, 5, 3]], convexity = 1); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 2], [0, 0, 0, 1]]) { + cube(size = [8, 3, 3], center = true); + } + } + } + diff --git a/tests/regression/dumptest/projection-expected.txt b/tests/regression/dumptest/projection-expected.txt index d776c2e..85611b4 100644 --- a/tests/regression/dumptest/projection-expected.txt +++ b/tests/regression/dumptest/projection-expected.txt @@ -1,3 +1,2 @@ -group() { projection(cut = false, convexity = 0); -} + diff --git a/tests/regression/dumptest/projection-tests-expected.txt b/tests/regression/dumptest/projection-tests-expected.txt index 836c115..e51ce8e 100644 --- a/tests/regression/dumptest/projection-tests-expected.txt +++ b/tests/regression/dumptest/projection-tests-expected.txt @@ -1,11 +1,15 @@ -group() { - linear_extrude(file = "", cache = "0.0", layer = "", height = 20, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + projection(cut = false, convexity = 0); + projection(cut = false, convexity = 0); + projection(cut = true, convexity = 0) { + square(size = [1, 1], center = false); + } + linear_extrude(height = 20, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { projection(cut = false, convexity = 0) { sphere($fn = 0, $fa = 12, $fs = 1, r = 10); } } multmatrix([[1, 0, 0, 22], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { - linear_extrude(file = "", cache = "0.0", layer = "", height = 20, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + linear_extrude(height = 20, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { projection(cut = true, convexity = 0) { multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 9], [0, 0, 0, 1]]) { sphere($fn = 0, $fa = 12, $fs = 1, r = 10); @@ -14,7 +18,7 @@ group() { } } multmatrix([[1, 0, 0, 44], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { - linear_extrude(file = "", cache = "0.0", layer = "", height = 20, origin = [ 0 0 ], scale = 1, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + linear_extrude(height = 20, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { projection(cut = true, convexity = 0) { multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 7], [0, 0, 0, 1]]) { sphere($fn = 0, $fa = 12, $fs = 1, r = 10); @@ -22,4 +26,4 @@ group() { } } } -} + diff --git a/tests/regression/dumptest/render-expected.txt b/tests/regression/dumptest/render-expected.txt index c599c6b..dcc005e 100644 --- a/tests/regression/dumptest/render-expected.txt +++ b/tests/regression/dumptest/render-expected.txt @@ -1,3 +1,2 @@ -group() { render(convexity = 1); -} + diff --git a/tests/regression/dumptest/render-tests-expected.txt b/tests/regression/dumptest/render-tests-expected.txt new file mode 100644 index 0000000..6914270 --- /dev/null +++ b/tests/regression/dumptest/render-tests-expected.txt @@ -0,0 +1,71 @@ + render(convexity = 1); + render(convexity = 1); + group() { + difference() { + cube(size = [100, 100, 100], center = true); + multmatrix([[1, 0, 0, -50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1, -1.22465e-16, 0, 0], [1.22465e-16, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + } + } + } + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1.83697e-16, 1, 0, 0], [-1, -1.83697e-16, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + } + } + } + } + } + } + multmatrix([[1, 0, 0, 110], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + difference() { + cube(size = [100, 100, 100], center = true); + multmatrix([[1, 0, 0, -50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1, -1.22465e-16, 0, 0], [1.22465e-16, -1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + group() { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + } + } + } + } + } + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, -50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[-1.83697e-16, 1, 0, 0], [-1, -1.83697e-16, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + render(convexity = 2) { + group() { + difference() { + cube(size = [20, 20, 150], center = true); + multmatrix([[1, 0, 0, -10], [0, 1, 0, -10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 80, r1 = 10, r2 = 10, center = true); + } + } + } + } + } + } + } + } + } + } + diff --git a/tests/regression/dumptest/root-modifier-expected.txt b/tests/regression/dumptest/root-modifier-expected.txt new file mode 100644 index 0000000..ca75e52 --- /dev/null +++ b/tests/regression/dumptest/root-modifier-expected.txt @@ -0,0 +1,5 @@ + difference() { + sphere($fn = 0, $fa = 12, $fs = 1, r = 10); + cylinder($fn = 0, $fa = 12, $fs = 1, h = 30, r1 = 6, r2 = 6, center = true); + } + diff --git a/tests/regression/dumptest/rotate-expected.txt b/tests/regression/dumptest/rotate-expected.txt index 87e28e2..c3185a3 100644 --- a/tests/regression/dumptest/rotate-expected.txt +++ b/tests/regression/dumptest/rotate-expected.txt @@ -1,3 +1,2 @@ -group() { multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); -} + diff --git a/tests/regression/dumptest/rotate_extrude-expected.txt b/tests/regression/dumptest/rotate_extrude-expected.txt index e2f5832..9ab8f0f 100644 --- a/tests/regression/dumptest/rotate_extrude-expected.txt +++ b/tests/regression/dumptest/rotate_extrude-expected.txt @@ -1,3 +1,2 @@ -group() { rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1); -} + diff --git a/tests/regression/dumptest/rotate_extrude-tests-expected.txt b/tests/regression/dumptest/rotate_extrude-tests-expected.txt index 068d32c..f3deec2 100644 --- a/tests/regression/dumptest/rotate_extrude-tests-expected.txt +++ b/tests/regression/dumptest/rotate_extrude-tests-expected.txt @@ -1,7 +1,45 @@ -group() { - rotate_extrude(file = "", cache = "0.0", layer = "", origin = [ 0 0 ], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1); + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1); + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + cube(size = [1, 1, 1], center = false); + } + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1) { multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { circle($fn = 0, $fa = 12, $fs = 1, r = 10); } } -} + multmatrix([[1, 0, 0, 50], [0, 1, 0, -20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + circle($fn = 0, $fa = 12, $fs = 1, r = 10); + circle($fn = 0, $fa = 12, $fs = 1, r = 8); + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [100, 100, 100], center = true); + } + } + } + multmatrix([[1, 0, 0, 50], [0, 1, 0, 50], [0, 0, 1, 0], [0, 0, 0, 1]]) { + difference() { + difference() { + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 10); + } + } + rotate_extrude(convexity = 1, $fn = 0, $fa = 12, $fs = 1) { + multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + circle($fn = 0, $fa = 12, $fs = 1, r = 8); + } + } + } + multmatrix([[1, 0, 0, -50], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + cube(size = [100, 100, 100], center = true); + } + } + } + diff --git a/tests/regression/dumptest/rotate_extrude_dxf-tests-expected.txt b/tests/regression/dumptest/rotate_extrude_dxf-tests-expected.txt new file mode 100644 index 0000000..77ba467 --- /dev/null +++ b/tests/regression/dumptest/rotate_extrude_dxf-tests-expected.txt @@ -0,0 +1,2 @@ + rotate_extrude(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/dxf/open-polyline.dxf", cache = "4ead4109.2d8a", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 1); + diff --git a/tests/regression/dumptest/scale-expected.txt b/tests/regression/dumptest/scale-expected.txt index 87e28e2..c3185a3 100644 --- a/tests/regression/dumptest/scale-expected.txt +++ b/tests/regression/dumptest/scale-expected.txt @@ -1,3 +1,2 @@ -group() { multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); -} + diff --git a/tests/regression/dumptest/sphere-expected.txt b/tests/regression/dumptest/sphere-expected.txt index bc8bc7b..3a93101 100644 --- a/tests/regression/dumptest/sphere-expected.txt +++ b/tests/regression/dumptest/sphere-expected.txt @@ -1,3 +1,2 @@ -group() { sphere($fn = 0, $fa = 12, $fs = 1, r = 1); -} + diff --git a/tests/regression/dumptest/sphere-tests-expected.txt b/tests/regression/dumptest/sphere-tests-expected.txt index a672c23..f6f6a49 100644 --- a/tests/regression/dumptest/sphere-tests-expected.txt +++ b/tests/regression/dumptest/sphere-tests-expected.txt @@ -1,12 +1,29 @@ -group() { - sphere($fn = 0, $fa = 12, $fs = 1, r = 5); - multmatrix([[1, 0, 0, 0], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { - sphere($fn = 0, $fa = 5, $fs = 0.5, r = 5); + sphere($fn = 0, $fa = 12, $fs = 1, r = 1); + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 0); } - multmatrix([[1, 0, 0, 12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { - sphere($fn = 0, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); } - multmatrix([[1, 0, 0, 12], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { - sphere($fn = 5, $fa = 12, $fs = 1, r = 6); + multmatrix([[1, 0, 0, 0], [0, 1, 0, -11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 12, $fs = 1, r = 5); } -} + multmatrix([[1, 0, 0, 11], [0, 1, 0, -11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, 11], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 10, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, 11], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 15, $fa = 12, $fs = 1, r = 5); + } + multmatrix([[1, 0, 0, 22], [0, 1, 0, -11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 20, $fs = 0.3, r = 5); + } + multmatrix([[1, 0, 0, 22], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 30, $fs = 0.3, r = 5); + } + multmatrix([[1, 0, 0, 22], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + sphere($fn = 0, $fa = 40, $fs = 0.3, r = 5); + } + diff --git a/tests/regression/dumptest/square-expected.txt b/tests/regression/dumptest/square-expected.txt index a4a24d8..0f14657 100644 --- a/tests/regression/dumptest/square-expected.txt +++ b/tests/regression/dumptest/square-expected.txt @@ -1,3 +1,2 @@ -group() { square(size = [1, 1], center = false); -} + diff --git a/tests/regression/dumptest/square-tests-expected.txt b/tests/regression/dumptest/square-tests-expected.txt new file mode 100644 index 0000000..c23c83d --- /dev/null +++ b/tests/regression/dumptest/square-tests-expected.txt @@ -0,0 +1,23 @@ + square(size = [1, 1], center = false); + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [1, 1], center = true); + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [1, 1], center = true); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [0, 0], center = true); + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [1, 0], center = true); + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [0, 1], center = true); + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [1, 2], center = true); + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + square(size = [2, 1], center = true); + } + diff --git a/tests/regression/dumptest/string-test-expected.txt b/tests/regression/dumptest/string-test-expected.txt index 434cc8f..b2915cb 100644 --- a/tests/regression/dumptest/string-test-expected.txt +++ b/tests/regression/dumptest/string-test-expected.txt @@ -1,3 +1,2 @@ -group() { group(); -} + diff --git a/tests/regression/dumptest/subdiv-expected.txt b/tests/regression/dumptest/subdiv-expected.txt index bc40dc2..cd7d37e 100644 --- a/tests/regression/dumptest/subdiv-expected.txt +++ b/tests/regression/dumptest/subdiv-expected.txt @@ -1,3 +1,2 @@ -group() { subdiv(level = 1, convexity = 0); -} + diff --git a/tests/regression/dumptest/surface-expected.txt b/tests/regression/dumptest/surface-expected.txt index 4c9b5b8..7ed73bd 100644 --- a/tests/regression/dumptest/surface-expected.txt +++ b/tests/regression/dumptest/surface-expected.txt @@ -1,3 +1,2 @@ -group() { surface(file = "", center = false); -} + diff --git a/tests/regression/dumptest/surface-tests-expected.txt b/tests/regression/dumptest/surface-tests-expected.txt index 9786d85..9405aa4 100644 --- a/tests/regression/dumptest/surface-tests-expected.txt +++ b/tests/regression/dumptest/surface-tests-expected.txt @@ -1,3 +1,3 @@ -group() { - surface(file = "/Users/kintel/code/metalab/checkout/OpenSCAD/openscad-visitor/testdata/scad/surface.dat", center = false); -} + surface(file = "", center = false); + surface(file = "/Users/kintel/code/OpenSCAD/openscad/testdata/scad/features/surface.dat", center = true); + diff --git a/tests/regression/dumptest/testcolornames-expected.txt b/tests/regression/dumptest/testcolornames-expected.txt new file mode 100644 index 0000000..626a266 --- /dev/null +++ b/tests/regression/dumptest/testcolornames-expected.txt @@ -0,0 +1,706 @@ + multmatrix([[1, 0, 0, 1], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.803922, 0.360784, 0.360784, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.941176, 0.501961, 0.501961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.980392, 0.501961, 0.447059, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.913725, 0.588235, 0.478431, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.627451, 0.478431, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.862745, 0.0784314, 0.235294, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.698039, 0.133333, 0.133333, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.545098, 0, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.752941, 0.796078, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.713725, 0.756863, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.411765, 0.705882, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.0784314, 0.576471, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.780392, 0.0823529, 0.521569, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.858824, 0.439216, 0.576471, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.627451, 0.478431, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.498039, 0.313725, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.388235, 0.278431, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.270588, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.54902, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.647059, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.843137, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 1, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 1, 0.878431, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.980392, 0.803922, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.980392, 0.980392, 0.823529, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.937255, 0.835294, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.894118, 0.709804, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.854902, 0.72549, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.933333, 0.909804, 0.666667, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.941176, 0.901961, 0.54902, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.741176, 0.717647, 0.419608, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.901961, 0.901961, 0.980392, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.847059, 0.74902, 0.847059, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.866667, 0.627451, 0.866667, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.933333, 0.509804, 0.933333, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.854902, 0.439216, 0.839216, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.729412, 0.333333, 0.827451, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.576471, 0.439216, 0.858824, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.541176, 0.168627, 0.886275, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.580392, 0, 0.827451, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.6, 0.196078, 0.8, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.545098, 0, 0.545098, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.501961, 0, 0.501961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.294118, 0, 0.509804, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.282353, 0.239216, 0.545098, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.415686, 0.352941, 0.803922, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.482353, 0.407843, 0.933333, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.678431, 1, 0.184314, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.498039, 1, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.486275, 0.988235, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 1, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.196078, 0.803922, 0.196078, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.596078, 0.984314, 0.596078, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.564706, 0.933333, 0.564706, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.980392, 0.603922, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 1, 0.498039, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 5], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.235294, 0.701961, 0.443137, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.180392, 0.545098, 0.341176, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.133333, 0.545098, 0.133333, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.501961, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.392157, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.603922, 0.803922, 0.196078, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.419608, 0.556863, 0.137255, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.501961, 0.501961, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.333333, 0.419608, 0.184314, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.4, 0.803922, 0.666667, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.560784, 0.737255, 0.560784, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 6], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.12549, 0.698039, 0.666667, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.545098, 0.545098, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.501961, 0.501961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 1, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 1, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.878431, 1, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.686275, 0.933333, 0.933333, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.498039, 1, 0.831373, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.25098, 0.878431, 0.815686, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.282353, 0.819608, 0.8, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 7], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.807843, 0.819608, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.372549, 0.619608, 0.627451, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.27451, 0.509804, 0.705882, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.690196, 0.768627, 0.870588, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.690196, 0.878431, 0.901961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.678431, 0.847059, 0.901961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.529412, 0.807843, 0.921569, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.529412, 0.807843, 0.980392, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0.74902, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.117647, 0.564706, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.392157, 0.584314, 0.929412, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 8], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.254902, 0.411765, 0.882353, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0, 0.803922, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0, 0.545098, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0, 0.501961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.0980392, 0.0980392, 0.439216, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.972549, 0.862745, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.921569, 0.803922, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.894118, 0.768627, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.870588, 0.678431, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 9], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.960784, 0.870588, 0.701961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.870588, 0.721569, 0.529412, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.823529, 0.705882, 0.54902, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.737255, 0.560784, 0.560784, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.956863, 0.643137, 0.376471, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.854902, 0.647059, 0.12549, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.721569, 0.52549, 0.0431373, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.803922, 0.521569, 0.247059, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.823529, 0.411765, 0.117647, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.545098, 0.270588, 0.0745098, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.627451, 0.321569, 0.176471, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 10], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.647059, 0.164706, 0.164706, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.501961, 0, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 1, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.980392, 0.980392, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.941176, 1, 0.941176, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.960784, 1, 0.980392, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.941176, 1, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.941176, 0.972549, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 8], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.972549, 0.972549, 1, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.960784, 0.960784, 0.960784, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 11], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.960784, 0.933333, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.960784, 0.960784, 0.862745, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.992157, 0.960784, 0.901961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.980392, 0.941176, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 1, 0.941176, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.980392, 0.921569, 0.843137, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.980392, 0.941176, 0.901961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.941176, 0.960784, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([1, 0.894118, 0.882353, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 9], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.862745, 0.862745, 0.862745, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 10], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.827451, 0.827451, 0.827451, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.752941, 0.752941, 0.752941, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 1], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.662745, 0.662745, 0.662745, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 2], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.501961, 0.501961, 0.501961, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 3], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.411765, 0.411765, 0.411765, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 4], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.466667, 0.533333, 0.6, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 5], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.439216, 0.501961, 0.564706, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 6], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0.184314, 0.309804, 0.309804, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + multmatrix([[1, 0, 0, 7], [0, 1, 0, 13], [0, 0, 1, 0], [0, 0, 0, 1]]) { + color([0, 0, 0, 1]) { + sphere($fn = 5, $fa = 12, $fs = 1, r = 0.8); + } + } + diff --git a/tests/regression/dumptest/transform-tests-expected.txt b/tests/regression/dumptest/transform-tests-expected.txt new file mode 100644 index 0000000..97657da --- /dev/null +++ b/tests/regression/dumptest/transform-tests-expected.txt @@ -0,0 +1,44 @@ + multmatrix([[1, 0, 0, 25], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 0.5, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 10, r2 = 0, center = false); + } + } + } + multmatrix([[1, 0, 0, 20], [0, 1, 0, -30], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[0.5, 0, 0, 0], [0, 0.5, 0, 0], [0, 0, 0.5, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 10, r2 = 0, center = false); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -20], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[1, 0, 0, 0], [0, 2.22045e-16, -1, 0], [0, 1, 2.22045e-16, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 10, r2 = 0, center = false); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, -40], [0, 0, 1, 0], [0, 0, 0, 1]]) { + multmatrix([[0.707107, -1.11022e-16, 0.707107, 0], [0.707107, 2.22045e-16, -0.707107, 0], [0, 1, 3.33067e-16, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 10, r2 = 0, center = false); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 0.707107, 0.707107, 0], [0, -0.707107, 0.707107, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 10, r2 = 0, center = false); + } + } + multmatrix([[1, 0, 0, -25], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 10, r2 = 0, center = false); + } + } + multmatrix([[1, 0.4, 0.1, -25], [0.4, 0.8, 0, -25], [0.2, 0.2, 0.5, 0], [0, 0, 0, 1]]) { + group() { + cylinder($fn = 0, $fa = 12, $fs = 1, h = 20, r1 = 10, r2 = 0, center = false); + } + } + diff --git a/tests/regression/dumptest/translate-expected.txt b/tests/regression/dumptest/translate-expected.txt index 87e28e2..c3185a3 100644 --- a/tests/regression/dumptest/translate-expected.txt +++ b/tests/regression/dumptest/translate-expected.txt @@ -1,3 +1,2 @@ -group() { multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]); -} + diff --git a/tests/regression/dumptest/union-expected.txt b/tests/regression/dumptest/union-expected.txt index 34f53c2..654849e 100644 --- a/tests/regression/dumptest/union-expected.txt +++ b/tests/regression/dumptest/union-expected.txt @@ -1,3 +1,2 @@ -group() { union(); -} + diff --git a/tests/regression/dumptest/union-tests-expected.txt b/tests/regression/dumptest/union-tests-expected.txt new file mode 100644 index 0000000..b0a30f6 --- /dev/null +++ b/tests/regression/dumptest/union-tests-expected.txt @@ -0,0 +1,47 @@ + multmatrix([[1, 0, 0, -12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [10, 10, 10], center = false); + multmatrix([[1, 0, 0, 4], [0, 1, 0, 4], [0, 0, 1, 8], [0, 0, 0, 1]]) { + cube(size = [2, 2, 10], center = false); + } + } + } + union() { + cube(size = [10, 10, 10], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 10], [0, 0, 0, 1]]) { + cube(size = [2, 2, 10], center = false); + } + } + multmatrix([[1, 0, 0, 12], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [10, 10, 10], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 11], [0, 0, 0, 1]]) { + cube(size = [2, 2, 10], center = false); + } + } + } + multmatrix([[1, 0, 0, 24], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [10, 10, 10], center = false); + multmatrix([[1, 0, 0, 4], [0, 1, 0, 4], [0, 0, 1, 10], [0, 0, 0, 1]]) { + cube(size = [2, 2, 10], center = false); + } + } + } + multmatrix([[1, 0, 0, -12], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [10, 10, 10], center = false); + multmatrix([[1, 0, 0, -2], [0, 1, 0, 10], [0, 0, 1, 10], [0, 0, 0, 1]]) { + cube(size = [2, 2, 10], center = false); + } + } + } + multmatrix([[1, 0, 0, 0], [0, 1, 0, 12], [0, 0, 1, 0], [0, 0, 0, 1]]) { + union() { + cube(size = [10, 10, 10], center = false); + multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, 10], [0, 0, 0, 1]]) { + cube(size = [2, 2, 10], center = false); + } + } + } + diff --git a/tests/tests-common.cc b/tests/tests-common.cc new file mode 100644 index 0000000..1f19c59 --- /dev/null +++ b/tests/tests-common.cc @@ -0,0 +1,32 @@ +#include "tests-common.h" +#include "openscad.h" +#include "module.h" +#include "handle_dep.h" + +#include <QFile> +#include <QFileInfo> +#include <sstream> + +AbstractModule *parsefile(const char *filename) +{ + AbstractModule *root_module = NULL; + + QFileInfo fileInfo(filename); + handle_dep(filename); + FILE *fp = fopen(filename, "rt"); + if (!fp) { + fprintf(stderr, "Can't open input file `%s'!\n", filename); + } else { + std::stringstream text; + char buffer[513]; + int ret; + while ((ret = fread(buffer, 1, 512, fp)) > 0) { + buffer[ret] = 0; + text << buffer; + } + fclose(fp); + text << commandline_commands; + root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false); + } + return root_module; +} diff --git a/tests/tests-common.h b/tests/tests-common.h new file mode 100644 index 0000000..92ebc78 --- /dev/null +++ b/tests/tests-common.h @@ -0,0 +1,6 @@ +#ifndef TESTS_COMMON_H_ +#define TESTS_COMMON_H_ + +class AbstractModule *parsefile(const char *filename); + +#endif |