From 03a2da9f4a63d8e384c91b0daf41eecdb9079336 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Fri, 23 Dec 2011 14:12:35 +0100 Subject: Test case for recent CSG regression reported by Ed Nisley diff --git a/testdata/scad/bugs/bbox-transform-bug.scad b/testdata/scad/bugs/bbox-transform-bug.scad new file mode 100644 index 0000000..ccd2eab --- /dev/null +++ b/testdata/scad/bugs/bbox-transform-bug.scad @@ -0,0 +1,9 @@ +// +// Bug description: The intersection results in an empty object. +// Cause: The rotated bounding box is wrongly calculated, yielding a +// box which don't overlap with the bounding box of the second object. +// +intersection() { + rotate(45) cube(10); + translate([3,2,0]) cube(10); +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e98dd8e..20a9ede 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -531,7 +531,8 @@ list(APPEND DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test list(APPEND CGALPNGTEST_FILES ${FEATURES_FILES} ${SCAD_DXF_FILES} ${EXAMPLE_FILES}) list(APPEND OPENCSGTEST_FILES ${CGALPNGTEST_FILES}) -list(APPEND THROWNTOGETHERTEST_FILES ${CGALPNGTEST_FILES}) +list(APPEND OPENCSGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/bbox-transform-bug.scad) +list(APPEND THROWNTOGETHERTEST_FILES ${OPENCSGTEST_FILES}) # Disable tests which are known to cause floating point comparison issues # Once we're capable of comparing these across platforms, we can put these back in diff --git a/tests/regression/opencsgtest/bbox-transform-bug-expected.png b/tests/regression/opencsgtest/bbox-transform-bug-expected.png new file mode 100644 index 0000000..060b921 Binary files /dev/null and b/tests/regression/opencsgtest/bbox-transform-bug-expected.png differ diff --git a/tests/regression/throwntogethertest/bbox-transform-bug-expected.png b/tests/regression/throwntogethertest/bbox-transform-bug-expected.png new file mode 100644 index 0000000..f65e09c Binary files /dev/null and b/tests/regression/throwntogethertest/bbox-transform-bug-expected.png differ -- cgit v0.10.1