Ok, thanks again to everyone for testing out this stuff and pointing out bugs. Here's a new upload with a few changes:
- Fixed a few memory leaks and fixed copy constructor in b2Polygon
- Fixed clockwise/counterclockwise bugs, hopefully these are gone for good now!
- Added _extremely_ experimental b2Polygon TraceEdge(b2Polygon* p) function to try and handle non-convex polygons, see the ConvexDecomposition.h file for an example.
There is at least one known bug in this stuff, which is that if you have "pinch points," where a polygon comes back and touches itself, the triangulator will usually give up, in which case the results will be empty. This happens quite often using the TraceEdge function, because any sort of figure-eight type creation will have pinch points. I'm working on this, I'll let you know when I have a fix. I wouldn't rely on TraceEdge for anything too important yet.
Let me know about any other bugs, though, I'd like to know all the cases where this stuff fails so I can take care of them.
- Fixed a few memory leaks and fixed copy constructor in b2Polygon
- Fixed clockwise/counterclockwise bugs, hopefully these are gone for good now!
- Added _extremely_ experimental b2Polygon TraceEdge(b2Polygon* p) function to try and handle non-convex polygons, see the ConvexDecomposition.h file for an example.
There is at least one known bug in this stuff, which is that if you have "pinch points," where a polygon comes back and touches itself, the triangulator will usually give up, in which case the results will be empty. This happens quite often using the TraceEdge function, because any sort of figure-eight type creation will have pinch points. I'm working on this, I'll let you know when I have a fix. I wouldn't rely on TraceEdge for anything too important yet.
Let me know about any other bugs, though, I'd like to know all the cases where this stuff fails so I can take care of them.