Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Geometry] - Union generates polygon with punctures
From: Olivier Heriveaux (hodevel_at_[hidden])
Date: 2013-07-03 06:22:52


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




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net