I am doing a survey of polygon/geometric algorithm libraries implemented in Objective C, C or C++ (in that order of preference). I have very specific needs, so I figured I’d ask the community to see if anyone knows of one that meets some or all of them since I’d prefer to use one library/API for all my needs. This is what I need to be able to do:
- Intersection of 2 polygons
- Determine if two polygons are congruent (i.e. the same shape and size though they may be rotated or mirrored)
- 2d bin packing of convex polygons (aka sheet cutting – or open-ended bin packing so I’m maximizing the use of a run of material of fixed width)
- Same as #3 but for concave polygons
- The ability to take a set of line segments, some of which share endpoints and some of which intersect each other and turn it into a set of polygon
- Same as #5 but with the added ability to detect polygons with holes and break it into 2 polygons (at least one of which would be concave)
- Bonus: any or all of the above with closed shapes that consist of lines and curves
These are in the order of priority and I can work around the absence of any of them (my application just becomes less useful). so for example, if I had a library that only did 1 and 2, I would find that more useful than one that did 3-7.
In C++ it exists some libraries to work with the polygon geometry but I don’t know one that fully corresponds to your needs.
A very useful library that I know in C++ is CGAL. It covers some of your needs, but not all.