summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testdata/scad/features/polygon-tests.scad17
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/regression/cgalpngtest/polygon-tests-expected.pngbin0 -> 8240 bytes
3 files changed, 18 insertions, 0 deletions
diff --git a/testdata/scad/features/polygon-tests.scad b/testdata/scad/features/polygon-tests.scad
new file mode 100644
index 0000000..ab3a345
--- /dev/null
+++ b/testdata/scad/features/polygon-tests.scad
@@ -0,0 +1,17 @@
+polygon();
+polygon([]);
+polygon([[],[]]);
+polygon([[[]]]);
+translate([2,0,0]) polygon([[0,0], [1,0], [1,1]]);
+translate([0,2,0]) polygon([[0,0]]);
+translate([2,2,0]) polygon([[0,0],[1,1]]);
+translate([2,2,0]) polygon([[0,0],[1,1],[2,2]]);
+translate([0,-2,0]) polygon(points=[[0,0], [1,0], [1,1], [0,1]]);
+translate([0,-4,0]) polygon(points=[[0,0], [1,0], [1,1], [0,1]], paths=[]);
+translate([2,-2,0]) polygon([[0,0], [1,0], [0.8,0.5], [1,1], [0,1]]);
+
+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]];
+translate([-2,0,0]) polygon(points);
+translate([-2,-2,0]) polygon(points=points, paths=[[0,1,2,3], [4,5,6,7]]);
+
+// FIXME: convexity
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 30879f7..2bdef54 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -208,6 +208,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/polygon-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/polygon-tests-expected.png b/tests/regression/cgalpngtest/polygon-tests-expected.png
new file mode 100644
index 0000000..89aed2f
--- /dev/null
+++ b/tests/regression/cgalpngtest/polygon-tests-expected.png
Binary files differ
contact: Jan Huwald // Impressum