
Hi, On 3-7-2013 12:22, Olivier Heriveaux wrote:
Hello !
I'm trying to use Boost.Geometry library to implement Minkowsky algorithm (i.e. polygon convolution). I try to implement it in the same way Boost.Polygon does, but during the algorithm execution, a boost::geometry::overlay_invalid_input_exception is raised.
It seems that one of the input polygons to the union_ function is invalid. To understand my mistake, I outputed the operand polygons to SVG files and I discovered punctures in one of them. I believe Boost.Geometry thinks my polygon is self-intersecting (may be due to precision error with floats ?) - but this polygon itself is the result of a previous union operation.
For info, I attached the SVG file (use inkscape to see it completely since segments are out of the box due to negative coordinates).
I don't know if solutions to this problem exists or if the library is faulty (the bad polygon is the result of an union operation). One workaround would be to detect punctures and remove them, but it's kind of ugly imho...
Some more details: - point coordinates type is float, - I use custom class instead of point_xy model, - polygon winding is counter-clockwise.
Thank you in advance for any help, Olivier
Thanks for the report - can you give more details, especially WKT of the two input polygons? Or the sequence of algorithms you are using? These spikes normally never occur in unions, however in difference they might occur in some circumstances. Is this also happening with double typed data (in case you know)? Regards, Barend