summaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-12-15 23:19:05 (GMT)
committerMarius Kintel <marius@kintel.net>2013-12-15 23:19:05 (GMT)
commit446dc3d36d36ee3786615c6297a141c01ed972c0 (patch)
treee8d4e9f4a445a50b74d4c6d1dc4b111e6f715f82 /testdata
parent7a35d0c10d9ec6203d43ec11e1da721dd26b3be8 (diff)
Improved non-planar tests
Diffstat (limited to 'testdata')
-rw-r--r--testdata/scad/features/polyhedron-nonplanar-tests.scad (renamed from testdata/scad/bugs/nonplanar_polyhedron.scad)32
1 files changed, 29 insertions, 3 deletions
diff --git a/testdata/scad/bugs/nonplanar_polyhedron.scad b/testdata/scad/features/polyhedron-nonplanar-tests.scad
index b92d57e..19e76b6 100644
--- a/testdata/scad/bugs/nonplanar_polyhedron.scad
+++ b/testdata/scad/features/polyhedron-nonplanar-tests.scad
@@ -1,6 +1,32 @@
-// test polyhedrons where the facets are not, stritcly speaking, planar,
-// but instead "near planar". see issue #349 in github.
-polyhedron(points = [[-10., -13.090169943749475, -34.270509831248425],
+// Used to cause issue #349
+
+// Very slightly non-planar polyhedron
+polyhedron(faces=[[3,2,1,0],[7,6,5,4],[0,1,6,7],[1,2,5,6],[2,3,4,5],[3,0,7,4]],
+points=[
+ [0.0174497,-0.0174524,0.999695],
+ [1.0173,-0.0174524,0.982243],
+ [1.0176,0.982395,0.999693],
+ [0.0177543,0.982395,1.01715],
+ [0.000304586,0.999848,0.0174497],
+ [1.00015,0.999848,-0.00000265809],
+ [0.999848,-0.0000000000000271051,-0.0174524],
+ [0,0,0]]);
+
+// Really non-planar polyhedron
+translate([2,0,0]) polyhedron(faces=[[3,2,1,0],[7,6,5,4],[0,1,6,7],[1,2,5,6],[2,3,4,5],[3,0,7,4]],
+points=[
+ [0,0,1],
+ [1,0.2,1],
+ [1,1,1],
+ [0,1,1],
+ [0,1,0],
+ [1,1,0],
+ [1,0,0],
+ [0,0,0]]);
+
+// Real-world example: truncated icosidodecahedron
+translate([4.5,0.5,0.5]) scale(0.02) polyhedron(points = [
+[-10., -13.090169943749475, -34.270509831248425],
[-10., -13.090169943749475, 34.270509831248425],
[-10., 13.090169943749475, -34.270509831248425],
[-10., 13.090169943749475, 34.270509831248425],
contact: Jan Huwald // Impressum