diff options
Diffstat (limited to 'tests')
27 files changed, 376 insertions, 47 deletions
| diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d178f0f..de4bab7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -406,6 +406,8 @@ set(CORE_SOURCES    ../src/ModuleCache.cc     ../src/node.cc     ../src/context.cc  +  ../src/modcontext.cc  +  ../src/evalcontext.cc     ../src/csgterm.cc     ../src/csgtermnormalizer.cc     ../src/polyset.cc  @@ -754,12 +756,15 @@ list(APPEND ECHO_FILES ${FUNCTION_FILES}  list(APPEND DUMPTEST_FILES ${MINIMAL_FILES} ${FEATURES_FILES} ${EXAMPLE_FILES})  list(APPEND DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad                             ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad -                           ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad) +                           ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad +                           ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/localfiles-test.scad)  list(APPEND CGALPNGTEST_FILES ${FEATURES_FILES} ${SCAD_DXF_FILES} ${EXAMPLE_FILES})  list(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad                             ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad -                           ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/transform-nan-inf-tests.scad) +                           ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/transform-nan-inf-tests.scad +                           ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/localfiles-test.scad) +  list(APPEND OPENCSGTEST_FILES ${CGALPNGTEST_FILES})  list(APPEND OPENCSGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/bbox-transform-bug.scad)  list(APPEND OPENCSGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/intersection-prune-test.scad) diff --git a/tests/cgalcachetest.cc b/tests/cgalcachetest.cc index b7e51b5..b65a2c8 100644 --- a/tests/cgalcachetest.cc +++ b/tests/cgalcachetest.cc @@ -30,7 +30,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -129,11 +129,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	root_module = parsefile(filename);  	if (!root_module) { diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc index 947a231..afc3128 100644 --- a/tests/cgalpngtest.cc +++ b/tests/cgalpngtest.cc @@ -30,7 +30,7 @@  #include "node.h"  #include "module.h"  #include "polyset.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -102,11 +102,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	root_module = parsefile(filename);  	if (!root_module) { diff --git a/tests/cgalstlsanitytest.cc b/tests/cgalstlsanitytest.cc index 228bfde..49a3f8e 100644 --- a/tests/cgalstlsanitytest.cc +++ b/tests/cgalstlsanitytest.cc @@ -29,7 +29,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -84,11 +84,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	root_module = parsefile(filename);  	if (!root_module) { diff --git a/tests/cgaltest.cc b/tests/cgaltest.cc index 9c8c090..b7ae669 100644 --- a/tests/cgaltest.cc +++ b/tests/cgaltest.cc @@ -29,7 +29,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -81,11 +81,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	root_module = parsefile(filename);  	if (!root_module) { diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc index 864ba5d..f4a88e0 100644 --- a/tests/csgtermtest.cc +++ b/tests/csgtermtest.cc @@ -31,7 +31,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -76,11 +76,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	const AbstractNode *root_node;  	root_module = parsefile(filename); diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc index 1e518e2..6da6411 100644 --- a/tests/csgtestcore.cc +++ b/tests/csgtestcore.cc @@ -6,7 +6,7 @@  #include "openscad.h"  #include "parsersettings.h"  #include "builtin.h" -#include "context.h" +#include "modcontext.h"  #include "node.h"  #include "module.h"  #include "polyset.h" @@ -132,11 +132,11 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	if (sysinfo_dump)  		root_module = parse("sphere();","",false); diff --git a/tests/csgtexttest.cc b/tests/csgtexttest.cc index 6a72dff..3e26814 100644 --- a/tests/csgtexttest.cc +++ b/tests/csgtexttest.cc @@ -31,7 +31,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -80,11 +80,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	AbstractNode *root_node;  	root_module = parsefile(filename); diff --git a/tests/dumptest.cc b/tests/dumptest.cc index 4ddefe2..e0d2776 100644 --- a/tests/dumptest.cc +++ b/tests/dumptest.cc @@ -29,7 +29,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -86,11 +86,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	AbstractNode *root_node;  	root_module = parsefile(filename); @@ -115,7 +115,6 @@ int main(int argc, char **argv)  		exit(1);  	} -	fs::current_path(original_path);  	std::ofstream outfile;  	outfile.open(outfilename);  	outfile << dumpstdstr << "\n"; @@ -124,21 +123,22 @@ int main(int argc, char **argv)  	delete root_node;  	delete root_module; +	fs::current_path(original_path);  	root_module = parsefile(outfilename);  	if (!root_module) {  		fprintf(stderr, "Error: Unable to read back dumped file\n");  		exit(1);  	} -	if (fs::path(filename).has_parent_path()) { -		fs::current_path(fs::path(filename).parent_path()); -	} -  	AbstractNode::resetIndexCounter();  	root_node = root_module->evaluate(&root_ctx, &root_inst);  	tree.setRoot(root_node); +	if (fs::path(outfilename).has_parent_path()) { +		fs::current_path(fs::path(outfilename).parent_path()); +	} +  	string readbackstr = dumptree(tree, *root_node);  	if (dumpstdstr != readbackstr) {  		fprintf(stderr, "Error: Readback is different from original dump:\n"); diff --git a/tests/echotest.cc b/tests/echotest.cc index af4942b..9924d11 100644 --- a/tests/echotest.cc +++ b/tests/echotest.cc @@ -29,7 +29,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "builtin.h"  #include "printutils.h" @@ -88,11 +88,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	AbstractNode *root_node;  	root_module = parsefile(filename); diff --git a/tests/modulecachetest.cc b/tests/modulecachetest.cc index 1103720..62f9543 100644 --- a/tests/modulecachetest.cc +++ b/tests/modulecachetest.cc @@ -29,7 +29,7 @@  #include "parsersettings.h"  #include "node.h"  #include "module.h" -#include "context.h" +#include "modcontext.h"  #include "value.h"  #include "export.h"  #include "builtin.h" @@ -76,11 +76,11 @@ int main(int argc, char **argv)  	parser_init(boosty::stringy(fs::path(argv[0]).branch_path()));  	add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); -	Context root_ctx; -	register_builtin(root_ctx); +	ModuleContext root_ctx; +	root_ctx.registerBuiltin();  	AbstractModule *root_module; -	ModuleInstantiation root_inst; +	ModuleInstantiation root_inst("group");  	AbstractNode *root_node;  	root_module = parsefile(filename); diff --git a/tests/regression/cgalpngtest/child-child-test-expected.png b/tests/regression/cgalpngtest/child-child-test-expected.pngBinary files differ new file mode 100644 index 0000000..80b70ba --- /dev/null +++ b/tests/regression/cgalpngtest/child-child-test-expected.png diff --git a/tests/regression/cgalpngtest/localfiles-test-expected.png b/tests/regression/cgalpngtest/localfiles-test-expected.pngBinary files differ new file mode 100644 index 0000000..3ad3d96 --- /dev/null +++ b/tests/regression/cgalpngtest/localfiles-test-expected.png diff --git a/tests/regression/cgalpngtest/module-recursion-expected.png b/tests/regression/cgalpngtest/module-recursion-expected.pngBinary files differ new file mode 100644 index 0000000..3012a12 --- /dev/null +++ b/tests/regression/cgalpngtest/module-recursion-expected.png diff --git a/tests/regression/cgalpngtest/modulevariables-expected.png b/tests/regression/cgalpngtest/modulevariables-expected.pngBinary files differ new file mode 100644 index 0000000..0dc18e8 --- /dev/null +++ b/tests/regression/cgalpngtest/modulevariables-expected.png diff --git a/tests/regression/dumptest/child-child-test-expected.txt b/tests/regression/dumptest/child-child-test-expected.txt new file mode 100644 index 0000000..13f098d --- /dev/null +++ b/tests/regression/dumptest/child-child-test-expected.txt @@ -0,0 +1,59 @@ +	group() { +		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +			cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 5, r2 = 5, center = false); +		} +	} +	multmatrix([[1, 0, 0, 5], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { +		group() { +			multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +				group() { +					multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +						cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 5, r2 = 5, center = false); +					} +				} +			} +		} +	} +	multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { +		group() { +			multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +				group() { +					multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +						group() { +							multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +								group() { +									color([1, 0, 0, 1]) { +										cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 5, r2 = 5, center = false); +									} +								} +							} +						} +					} +				} +			} +		} +	} +	multmatrix([[1, 0, 0, 15], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { +		group() { +			color([1, 0, 0, 1]) { +				group() { +					multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +						group() { +							multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +								group() { +									multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +										group() { +											multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +												cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 5, r2 = 5, center = false); +											} +										} +									} +								} +							} +						} +					} +				} +			} +		} +	} + diff --git a/tests/regression/dumptest/localfiles-test-expected.txt b/tests/regression/dumptest/localfiles-test-expected.txt new file mode 100644 index 0000000..acdf7e7 --- /dev/null +++ b/tests/regression/dumptest/localfiles-test-expected.txt @@ -0,0 +1,17 @@ +	group() { +		linear_extrude(height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 2) { +			import(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2); +		} +		multmatrix([[1, 0, 0, -250], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { +			linear_extrude(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], scale = 1, height = 100, center = false, convexity = 1, $fn = 0, $fa = 12, $fs = 2); +		} +		multmatrix([[1, 0, 0, 0], [0, 1, 0, 350], [0, 0, 1, 0], [0, 0, 0, 1]]) { +			rotate_extrude(file = "localfiles_dir/localfile.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2); +		} +		multmatrix([[1, 0, 0, 250], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { +			multmatrix([[200, 0, 0, 0], [0, 200, 0, 0], [0, 0, 50, 0], [0, 0, 0, 1]]) { +				surface(file = "localfiles_dir/localfile.dat", center = false); +			} +		} +	} + diff --git a/tests/regression/dumptest/module-recursion-expected.txt b/tests/regression/dumptest/module-recursion-expected.txt new file mode 100644 index 0000000..9ad8877 --- /dev/null +++ b/tests/regression/dumptest/module-recursion-expected.txt @@ -0,0 +1,244 @@ +	group() { +		group() { +			cylinder($fn = 0, $fa = 12, $fs = 2, h = 1, r1 = 0.2, r2 = 0.2, center = false); +			multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 1], [0, 0, 0, 1]]) { +				group() { +					multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +						group() { +							group() { +								cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.7, r1 = 0.14, r2 = 0.14, center = false); +								multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.7], [0, 0, 0, 1]]) { +									group() { +										multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +											group() { +												group() { +													cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.49, r1 = 0.098, r2 = 0.098, center = false); +													multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.49], [0, 0, 0, 1]]) { +														group() { +															multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +															multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +														} +													} +												} +											} +										} +										multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +											group() { +												group() { +													cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.49, r1 = 0.098, r2 = 0.098, center = false); +													multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.49], [0, 0, 0, 1]]) { +														group() { +															multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +															multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +														} +													} +												} +											} +										} +									} +								} +							} +						} +					} +					multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +						group() { +							group() { +								cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.7, r1 = 0.14, r2 = 0.14, center = false); +								multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.7], [0, 0, 0, 1]]) { +									group() { +										multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +											group() { +												group() { +													cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.49, r1 = 0.098, r2 = 0.098, center = false); +													multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.49], [0, 0, 0, 1]]) { +														group() { +															multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +															multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +														} +													} +												} +											} +										} +										multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +											group() { +												group() { +													cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.49, r1 = 0.098, r2 = 0.098, center = false); +													multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.49], [0, 0, 0, 1]]) { +														group() { +															multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +															multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																group() { +																	group() { +																		cylinder($fn = 0, $fa = 12, $fs = 2, h = 0.343, r1 = 0.0686, r2 = 0.0686, center = false); +																		multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.343], [0, 0, 0, 1]]) { +																			group() { +																				multmatrix([[-1, 0, 0, 0], [0, -0.76604444311, 0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																				multmatrix([[1, 0, 0, 0], [0, 0.76604444311, -0.64278760968, 0], [0, 0.64278760968, 0.76604444311, 0], [0, 0, 0, 1]]) { +																					group() { +																						group(); +																					} +																				} +																			} +																		} +																	} +																} +															} +														} +													} +												} +											} +										} +									} +								} +							} +						} +					} +				} +			} +		} +	} + diff --git a/tests/regression/dumptest/modulevariables-expected.txt b/tests/regression/dumptest/modulevariables-expected.txt new file mode 100644 index 0000000..fed4bbc --- /dev/null +++ b/tests/regression/dumptest/modulevariables-expected.txt @@ -0,0 +1,4 @@ +	group() { +		cylinder($fn = 0, $fa = 12, $fs = 2, h = 10, r1 = 23, r2 = 10, center = false); +	} + diff --git a/tests/regression/opencsgtest/child-child-test-expected.png b/tests/regression/opencsgtest/child-child-test-expected.pngBinary files differ new file mode 100644 index 0000000..07d61c0 --- /dev/null +++ b/tests/regression/opencsgtest/child-child-test-expected.png diff --git a/tests/regression/opencsgtest/localfiles-test-expected.png b/tests/regression/opencsgtest/localfiles-test-expected.pngBinary files differ new file mode 100644 index 0000000..7bc7909 --- /dev/null +++ b/tests/regression/opencsgtest/localfiles-test-expected.png diff --git a/tests/regression/opencsgtest/module-recursion-expected.png b/tests/regression/opencsgtest/module-recursion-expected.pngBinary files differ new file mode 100644 index 0000000..324c260 --- /dev/null +++ b/tests/regression/opencsgtest/module-recursion-expected.png diff --git a/tests/regression/opencsgtest/modulevariables-expected.png b/tests/regression/opencsgtest/modulevariables-expected.pngBinary files differ new file mode 100644 index 0000000..bf23265 --- /dev/null +++ b/tests/regression/opencsgtest/modulevariables-expected.png diff --git a/tests/regression/throwntogethertest/child-child-test-expected.png b/tests/regression/throwntogethertest/child-child-test-expected.pngBinary files differ new file mode 100644 index 0000000..07d61c0 --- /dev/null +++ b/tests/regression/throwntogethertest/child-child-test-expected.png diff --git a/tests/regression/throwntogethertest/localfiles-test-expected.png b/tests/regression/throwntogethertest/localfiles-test-expected.pngBinary files differ new file mode 100644 index 0000000..7bc7909 --- /dev/null +++ b/tests/regression/throwntogethertest/localfiles-test-expected.png diff --git a/tests/regression/throwntogethertest/module-recursion-expected.png b/tests/regression/throwntogethertest/module-recursion-expected.pngBinary files differ new file mode 100644 index 0000000..324c260 --- /dev/null +++ b/tests/regression/throwntogethertest/module-recursion-expected.png diff --git a/tests/regression/throwntogethertest/modulevariables-expected.png b/tests/regression/throwntogethertest/modulevariables-expected.pngBinary files differ new file mode 100644 index 0000000..bf23265 --- /dev/null +++ b/tests/regression/throwntogethertest/modulevariables-expected.png | 
