diff --git a/src/db/db/dbPath.cc b/src/db/db/dbPath.cc index 59bcdb451..6136a0ee1 100644 --- a/src/db/db/dbPath.cc +++ b/src/db/db/dbPath.cc @@ -372,14 +372,7 @@ void path::create_shifted_points (C start, C end, C width, bool forward, Iter double l1 = db::vprod (nnd - nd, eed) / dv; double l2 = db::vprod (nd - nnd, ed) / dv; - if ((l1 < -db::epsilon) != (l2 < -db::epsilon)) { - - // No well-formed intersection (reflecting edge) -> - // create a direct connection - *pts++ = *pp + vector (nd); - *pts++ = *pp + vector (nnd); - - } else if (l1 < l1min - db::epsilon || l2 < l2min - db::epsilon) { + if (l1 < l1min - db::epsilon || l2 < l2min - db::epsilon) { // Segments are too short - the won't intersect: In this case we create a loop of three // points which define the area in self-overlapping way but confined to the path within diff --git a/src/db/unit_tests/dbPathTests.cc b/src/db/unit_tests/dbPathTests.cc index 10a8be0f1..deb3fe22e 100644 --- a/src/db/unit_tests/dbPathTests.cc +++ b/src/db/unit_tests/dbPathTests.cc @@ -362,3 +362,20 @@ TEST(11) EXPECT_EQ (to_string (pts), "(-100,10;1010,10;1010,-10;0,-10;0,10;1010,10;1010,-10;-100,-10)"); } +// issue #2002 +TEST(12) +{ + db::Path path; + db::Path::pointlist_type pts; + + tl::Extractor ("(143,381;262,260;381,141) w=400 bx=0 ex=0 r=false").read (path); + + path.hull (pts, 4); + EXPECT_EQ (to_string (pts), "(286,521;454,350;522,282;240,0;70,170;0,241)"); + + tl::Extractor ("(143,381;262,260;381,141) w=1000 bx=0 ex=0 r=false").read (path); + + path.hull (pts, 4); + EXPECT_EQ (to_string (pts), "(286,521;454,350;522,282;240,0;70,170;0,241;499,732;564,666;735,495;27,-213;-40,-146;-213,30)"); +} +