File: 0012-disable-remove-failing-test-PolygonTest-simplifyLimi.patch

package info (click to toggle)
cura-engine 1%3A5.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,860 kB
  • sloc: cpp: 52,613; python: 322; makefile: 10; sh: 2
file content (66 lines) | stat: -rw-r--r-- 2,635 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From: Sebastian Kuzminsky <sebastiankuzminsky@desktopmetal.com>
Date: Wed, 25 May 2022 10:19:43 -0600
Subject: disable/remove failing test: PolygonTest/simplifyLimitedError

---
 tests/utils/PolygonTest.cpp | 47 ---------------------------------------------
 1 file changed, 47 deletions(-)

diff --git a/tests/utils/PolygonTest.cpp b/tests/utils/PolygonTest.cpp
index 8b9be89..347da54 100644
--- a/tests/utils/PolygonTest.cpp
+++ b/tests/utils/PolygonTest.cpp
@@ -267,53 +267,6 @@ TEST_F(PolygonTest, simplifyLimitedLength)
     ASSERT_EQ(spiral.size(), 11 - 3) << "Should merge segments of length 1100 with 1200, 1300 with 1400 and first with last.";
 }
 
-TEST_F(PolygonTest, simplifyLimitedError)
-{
-    // Generate a large polygon with a small region with arbitrary simplifiable geometry
-    // We choose a spiral for that arbitrary geometry
-    
-    //Generate a square spiral with increasingly large corners
-    Polygons spiral_polygons;
-    PolygonRef spiral = spiral_polygons.newPoly();
-    spiral.emplace_back(-15000, 11000); // introduce points that may never be simplified so that we know the simplification should start at 0,0
-    spiral.emplace_back(-15000, 1000);
-    spiral.emplace_back(0, 0);
-
-    //Generate a square spiral, 90 degree corners to make it easy to compute the area loss while retaining a positive area per corner.
-    coord_t segment_length = 1000;
-    Point last_position(0, 0);
-    double angle = 0;
-    for (size_t i = 0; i < 10; i++)
-    {
-        const coord_t dx = std::cos(angle) * segment_length;
-        const coord_t dy = std::sin(angle) * segment_length;
-        last_position += Point(dx, dy);
-        spiral.add(last_position);
-        segment_length += 100;
-        angle += M_PI / 2;
-    }
-    Polygon spiral_before = spiral;
-
-    coord_t max_height = segment_length * std::sqrt(2.0); // the diameter of the circle along the diagonal
-
-    for (size_t i = 0; i < spiral_before.size(); ++i)
-    {
-        // apply simplify iteratively for each point until nothing is simplifiable any more
-        spiral_polygons.simplify(10000, max_height);
-    }
-    
-    if (visualize)
-    {
-        SVG svg("output/simplifyLimitedError.svg", AABB(spiral_before));
-        svg.writePolygon(spiral_before);
-        svg.nextLayer();
-        svg.writePolygon(spiral, SVG::Color::RED);
-    }
-
-    EXPECT_THAT(spiral.size(), testing::Eq(4)) << "Should simplify all spiral points except those connected to far away geometry.";
-}
-
-
 TEST_F(PolygonTest, simplifyIncreasingLimitedError)
 {
     // Generate a zigzag with bends in the outer ends with increasing height