-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix simplification of open path (#714)
* Add failing simplification test A slightly wiggly line from (0,0) to (0,100), which we expect to simplify to a straight line of length 100 with just the two endpoints remaining. Instead it simplifies to a much shorter line. * Don't recompute distance for open endpoint
- Loading branch information
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "clipper2/clipper.h" | ||
#include <gtest/gtest.h> | ||
|
||
using namespace Clipper2Lib; | ||
|
||
TEST(Clipper2Tests, TestSimplifyPath) { | ||
|
||
Path64 input1 = MakePath({ | ||
0,0, 1,1, 0,20, 0,21, 1,40, 0,41, 0,60, 0,61, 0,80, 1,81, 0,100 | ||
}); | ||
Path64 output1 = SimplifyPath(input1, 2, false); | ||
EXPECT_EQ(Length(output1), 100); | ||
EXPECT_EQ(output1.size(), 2); | ||
} |