(bool test_polytree = false)
| 68 | } |
| 69 | |
| 70 | public static void TrianglesTest(bool test_polytree = false) |
| 71 | { |
| 72 | Path64 tri1 = Clipper.MakePath(new int[] { 0,0, 20,0, 10,20 }); |
| 73 | Path64 tri2 = Clipper.MakePath(new int[] { 20,0, 10,20, 30,20 }); |
| 74 | |
| 75 | Paths64 subjects = new(), solution; |
| 76 | Random rand = new(); |
| 77 | for (int i = 0; i < 600 / 10 / 2; ++i) |
| 78 | { |
| 79 | for (int j = 0; j < 800 / 10 / 2; ++j) |
| 80 | { |
| 81 | if (rand.Next(4) != 0) subjects.Add(tri1); |
| 82 | if (rand.Next(4) != 0) subjects.Add(tri2); |
| 83 | tri1 = Clipper.TranslatePath(tri1, 20, 0); |
| 84 | tri2 = Clipper.TranslatePath(tri2, 20, 0); |
| 85 | |
| 86 | } |
| 87 | tri1 = Clipper.TranslatePath(tri1, (-800 / 10) * 10, 20); |
| 88 | tri2 = Clipper.TranslatePath(tri2, (-800 / 10) * 10, 20); |
| 89 | } |
| 90 | |
| 91 | if (test_polytree) |
| 92 | solution = Polytree_Union(subjects, FillRule.NonZero); |
| 93 | else |
| 94 | solution = Clipper.Union(subjects, FillRule.NonZero); |
| 95 | DisplayAsSvgImage("Triangles", FillRule.NonZero, subjects, null, solution); |
| 96 | } |
| 97 | |
| 98 | public static void DiamondsTest(bool test_polytree = false) |
| 99 | { |
nothing calls this directly
no test coverage detected