Hi Angus,
I'm not sure if there is interest in doing maintenance on ClipperLib, I can't help but notice there seem to be a number of unresolved geometry processing bugs. If there is interest though, here is an issue I encountered:
ClipperLib::Path a_ = {
{1, 1},
{2, 1},
{2, 0},
{4, 4},
};
ClipperLib::Path b_ = {
{3, 0},
{3, 3},
{0, 3},
{0, 0}
};
ClipperLib::Clipper c;
c.AddPath(a_, ClipperLib::ptSubject, false);
c.AddPath(b_, ClipperLib::ptClip, true);
ClipperLib::PolyTree solution;
c.Execute(ClipperLib::ctIntersection, solution, ClipperLib::pftNonZero, ClipperLib::pftNonZero);
ClipperLib::Paths solution_;
ClipperLib::PolyTreeToPaths(solution, solution_);
for (auto &e : solution_[0]) {
auto s1 = std::to_string(e.X);
auto s2 = std::to_string(e.Y);
printf("%s, %s\n", s1.c_str(), s2.c_str());
}
This prints an unexpected additional edge between 1,1 and 2,0. I couldn't tell if it was related to the skip edge or not, I found that the 1,1 <-> 2,1 edge would still be reversed even if it wasn't adjacent to the skip edge. I tried to fix it, but was eventually stuck while trying to undertand the reason ProcessBounds was reversing the edge. (Maybe it shouldn't be carrying the path direction across the skip edge? That sounds reasonable, but I'm just grasping here.)
And let it not go unsaid: Thank you for ClipperLib, it has been amazingly useful to me.
Have a nice day!
-nmr
Anonymous
Just commenting here now that I'm logged in, in order to subscribe to ticket.
This is the same issue as in https://sourceforge.net/p/polyclipping/bugs/183/, there one edge in the open path solution seems to be flipped.
Thanks, for the feedback, and your patience 😁.
I've just checked this and can confirm there is a bug there.
Hopefully I'll have a fix for it in the next few days.
Just curious whether you would be interested in a contract for a weeks worth of ClipperLib bug fixing? Feel free to ping me at nathan at acmeaom dot cee oh em.