summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testdata/scad/features/polyhedron-tests.scad20
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/regression/cgalpngtest/polyhedron-tests-expected.pngbin0 -> 9208 bytes
-rw-r--r--tests/regression/opencsgtest/polyhedron-tests-expected.pngbin0 -> 10415 bytes
4 files changed, 21 insertions, 0 deletions
diff --git a/testdata/scad/features/polyhedron-tests.scad b/testdata/scad/features/polyhedron-tests.scad
new file mode 100644
index 0000000..690d962
--- /dev/null
+++ b/testdata/scad/features/polyhedron-tests.scad
@@ -0,0 +1,20 @@
+module polyhedrons() {
+ 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]]);
+
+ // One face flipped
+ translate([2,0,0])
+ 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]]);
+
+ // All faces flipped
+ translate([4,0,0])
+ 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]]);
+}
+
+polyhedrons();
+translate([0,2,0]) difference() {
+ polyhedrons();
+ translate([2,0,2]) cube([8,3,3], center=true);
+}
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 4b6a9dd..606878a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -213,6 +213,7 @@ LIST(APPEND CGALPNGTEST_FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/features/cube-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/sphere-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/cylinder-tests.scad
+ ${CMAKE_SOURCE_DIR}/../testdata/scad/features/polyhedron-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/union-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/difference-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/features/intersection-tests.scad
diff --git a/tests/regression/cgalpngtest/polyhedron-tests-expected.png b/tests/regression/cgalpngtest/polyhedron-tests-expected.png
new file mode 100644
index 0000000..c80990f
--- /dev/null
+++ b/tests/regression/cgalpngtest/polyhedron-tests-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/polyhedron-tests-expected.png b/tests/regression/opencsgtest/polyhedron-tests-expected.png
new file mode 100644
index 0000000..0740f1a
--- /dev/null
+++ b/tests/regression/opencsgtest/polyhedron-tests-expected.png
Binary files differ
contact: Jan Huwald // Impressum