Minkowski difference
Polygon and line clipping and offsetting library (C++, C#, Delphi)
Brought to you by:
angusj
MinkowskiDiff should be returning a single polygon in this case, I think, but it's returning two overlapping polygons, the second of those very thin and, probably, unneede. See here the specific case: https://www.geogebra.org/graphing/nc2uaywn
Here it is a googletest failing testcase:
TEST(Clipper, MinkowskiBug) {
const ClipperLib::Path polygonA{{4927, 2529}, {15991, 0}, {24869, 7081}, {24869, 18429}};
const ClipperLib::Path polygonB{{-4925, 4551}, {-15992, 7080}, {-24869, 0}, {-24869, -11347}};
ClipperLib::Paths ret;
ClipperLib::MinkowskiDiff(polygonB, polygonA, ret);
EXPECT_EQ(ret.size(), 1U);
}
Anonymous