diff options
Diffstat (limited to 'testdata/scad/bugs')
| -rw-r--r-- | testdata/scad/bugs/polygon-illegal-winding.scad | 15 | ||||
| -rw-r--r-- | testdata/scad/bugs/polyset-reduce-crash.scad | 38 | ||||
| -rw-r--r-- | testdata/scad/bugs/polyset-reduce-crash.txt | 4 | 
3 files changed, 57 insertions, 0 deletions
diff --git a/testdata/scad/bugs/polygon-illegal-winding.scad b/testdata/scad/bugs/polygon-illegal-winding.scad new file mode 100644 index 0000000..612154a --- /dev/null +++ b/testdata/scad/bugs/polygon-illegal-winding.scad @@ -0,0 +1,15 @@ +polyhedron +  (points = [ +         [0, -10, 60], [0, 10, 60], [0, 10, 0], [0, -10, 0], [60, -10,  +60], [60, 10, 60], +         [10, -10, 50], [10, 10, 50], [10, 10, 30], [10, -10, 30], [30,  +-10, 50], [30, 10, 50] +         ], +   triangles = [ +        [0,2,3],   [0,1,2],  [0,4,5],  [0,5,1],   [5,4,2],  [2,4,3], +                [6,8,9],  [6,7,8],  [6,10,11], [6,11,7], [10,8,11], +        [10,9,8], [0,3,9],  [9,0,6], [10,6, 0],  [0,4,10], +                [3,9,10], [3,10,4], [1,7,11],  [1,11,5], [1,7,8],  +                [1,8,2],  [2,8,11], [2,11,5] +        ] +   ); diff --git a/testdata/scad/bugs/polyset-reduce-crash.scad b/testdata/scad/bugs/polyset-reduce-crash.scad new file mode 100644 index 0000000..ce9fae7 --- /dev/null +++ b/testdata/scad/bugs/polyset-reduce-crash.scad @@ -0,0 +1,38 @@ +N=20; + +rotate (a = [0, 0, 36]) { +  union() { +    translate ([1, 0]) { +	polygon (points = [[(N - 1)*cos(180/N), -(N - 1)*sin(180/N)], +			   [(N - 3)*cos(270/N), -(N - 3)*sin(270/N)], +			   [(N - 1)*cos(270/N), -(N - 1)*sin(270/N)]]); + +	polygon (points = [[(N - 1)*cos(180/N), -(N - 1)*sin(180/N)], +			   [(N - 3)*cos(180/N), -(N - 3)*sin(180/N)], +			   [(N - 3)*cos(270/N), -(N - 3)*sin(270/N)]]); + +	polygon (points = [[N - 1, 0], [N - 3, 0], +			   [(N - 3)*cos(180/N), -(N - 3)*sin(180/N)]]); + +	polygon (points = [[N - 1, 0], +			[(N - 3)*cos(180/N), -(N - 3)*sin(180/N)], +			[(N - 1)*cos(180/N), -(N - 1)*sin(180/N)]]); + +	polygon (points = [[N - 1, 0], [N - 3, 0], +			  [(N - 3)*cos(180/N), (N - 3)*sin(180/N)]]); + +	polygon (points = [[N - 1, 0], +			  [(N - 3)*cos(180/N), (N - 3)*sin(180/N)], +			  [(N - 1)*cos(180/N), (N - 1)*sin(180/N)]]); + +	polygon (points = [[(N - 1)*cos(180/N), (N - 1)*sin(180/N)], +			   [(N - 3)*cos(180/N), (N - 3)*sin(180/N)], +			   [(N - 3)*cos(270/N), (N - 3)*sin(270/N)]]); + +	polygon (points = [[(N - 1)*cos(180/N), (N - 1)*sin(180/N)], +			   [(N - 3)*cos(270/N), (N - 3)*sin(270/N)], +			   [(N - 1)*cos(270/N), (N - 1)*sin(270/N)]]); +    } +    circle (r = 20); +  } +} diff --git a/testdata/scad/bugs/polyset-reduce-crash.txt b/testdata/scad/bugs/polyset-reduce-crash.txt new file mode 100644 index 0000000..bc9e8d5 --- /dev/null +++ b/testdata/scad/bugs/polyset-reduce-crash.txt @@ -0,0 +1,4 @@ +This testcase causes a crash in PolySet::PolyReducer::add_edges(). +It appears to be because we collapse two close vertices into the same +vertex. This is handled by just abort()'ing. +  | 
