Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add methods to determine orientation of PolyLine #1411
I'd been using CGAL's Polygon_2 to determine the orientation but realized the math isn't that complicated and would be a nice addition to the PolyLine class.
The algorithm is based of this answer the FAQ for comp.graphics.algorithms:
And some other details I found on the Wikipedia Curve orientation page.
Thanks for your work on this and apologies for the delay. The implementation looks good to me, minus a few formatting things I can easily fix. It's a 100% subjective but I'd like to propose an interface tweak. For the most part we avoid function-specific enums in Cinder. To that end, I'd propose we ditch the
Again, I realize this is mostly just a different flavor of imperfect, but this would be a bit more consistent with Cinder at large.
Hey - the formatting stuff I'm noticing are mostly extra spaces, like
It's not all-encompassing but most of the important stuff is in the Contributing guide.
And I will take a look at the other two as well while we're in here.
I'd propose dropping it.
is roughly how I'd see this used in a case where we need to handle colinear. For the case where we're not worried about it:
Open to other opinions here, but I think the main advantage to