Skip to content

Commit 1ef1da4

Browse files
authored
Add regression test for #965 (#972)
1 parent f8dced5 commit 1ef1da4

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

CPP/Tests/TestOffsets.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,4 +674,27 @@ TEST(Clipper2Tests, TestOffsets12) // see #873
674674
};
675675
Paths64 solution = InflatePaths(subject, -249561088, JoinType::Miter, EndType::Polygon);
676676
EXPECT_TRUE(solution.empty());
677-
}
677+
}
678+
679+
TEST(Clipper2Tests, TestOffsets13) // see #965
680+
{
681+
const Path64 subject1 = {{0, 0}, {0, 10}, {10, 0}};
682+
const auto delta = 2;
683+
const auto joinType = JoinType::Miter;
684+
const auto endType = EndType::Polygon;
685+
686+
const Paths64 subjects1 = {
687+
subject1
688+
};
689+
const Paths64 solution1 = InflatePaths(subjects1, delta, joinType, endType);
690+
const auto area1 = std::abs(Area(solution1));
691+
EXPECT_EQ(area1, 122);
692+
693+
const Paths64 subjects2 = {
694+
subject1,
695+
{{0, 20}} // adding this single-point path should not really change the solution
696+
};
697+
const Paths64 solution2 = InflatePaths(subjects2, delta, joinType, endType);
698+
const auto area2 = std::abs(Area(solution2));
699+
EXPECT_EQ(area2, 122);
700+
}

0 commit comments

Comments
 (0)