I'm trying to use boost geometry to build vehicle ongoing
path of constant width with self intersections
Faced problems with result of boolean operations on
Here my path polygon on some step (more precisely
multipolygon in boost geometry):
On every step I use two points x,y (floats) - left and
right offseted by half of constant width from current
vehicle location. Let's call x-y line a segment.
When location of vehicle is updated, I
construct appended mpolygon using old x,y point and new
ones and firstly intersect it with path mpolygon, and then
union_ them (so path mpolygon gets longer).
Sometimes (especially for large enough width values) there
can be intersection of new segment with previous. In that
cases I construct appended mpolygon as two polygons using
calculated intersection point with bg::intersection of two segments.
See the picture: https://pp.vk.me/c631319/v631319687/1f03a/elt4y5KSfSM.jpg
result is a two polygons within mpolygon, not the one
as I expected. It appears not always, but quite often.
Next step, and again intersection of new segment with
previous, and again two polygons in appended mpolygon
This almost zero areas can be part of outer ring of
one polygon, or can be a separate polygon in mpolygon
within another biggest one (which brakes mpolygon
I suppose this is in the end cause this overlay invalid
input exceptions when performing intersection or union_
with such mpolygon.
Thinking that problem is in the floating point
inaccuracy (that maybe calculates slightly different
intersection point of polygons with shared edge when
performing union_ ), I even trying to solve this by
inserting intersection point of segments in outer ring
of current path polygon before doing union_. It slightly
reduces overlay invalid input exceptions when perform
intersection or union_, but not solve problem
If there any solutions of such problems?