Boost logo

Geometry :

Subject: Re: [geometry] boost::geometry::difference problem
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-09-15 03:38:45


Hi,
Sorry - I'm off, have to answer this next weekend.
Regards, Barend

On 14-9-2012 15:54, h2 wrote:
> Hi.
>
> I am troubled by funny behavior of boost::geometry::difference.
> Two cases below should be the same, but a different result comes back.
>
> *OK
> geometry1 MULTIPOLYGON(((-2 5, -1 5, 0 5, 2 5, 2 -2, 1 -2, 1 -1, 0 -1,
> 0 0, -1 0, -2 0, -2 5)))
> geometry2 MULTIPOLYGON(((0 0, 1 0, 1 -1, 0 -1, 0 0)), ((-1 5, 0 5, 0
> 0, -1 0, -1 5)))
> output MULTIPOLYGON(((0.0 5.0,2.0 5.0,2.0 -2.0,1.0 -2.0,1.0 -1.0,1.0
> 0.0,0.0 0.0,0.0 5.0)),((-1.0 5.0,-1.0 0.0,-2.0 0.0,-2.0 5.0,-1.0
> 5.0)))
>
> *NG
> geometry1 MULTIPOLYGON(((-2 5, -1 5, 0 5, 2 5, 2 -2, 1 -2, 1 -1, 0 -1,
> 0 0, -1 0, -2 0, -2 5)))
> geometry2 MULTIPOLYGON(((-1 5, 0 5, 0 0, -1 0, -1 5)), ((0 0, 1 0, 1
> -1, 0 -1, 0 0)))
> output MULTIPOLYGON(((-1.0 5.0,-1.0 0.0,-2.0 0.0,-2.0 5.0,-1.0 5.0)))
>
> As for the difference of both, polygon order of geometry2 is only reversed.
>
> I traced a program,
> Was found to be a pattern that is not supported by
> boost::geometry::detail::overlay::sort_in_cluster::operator().
> (geometry/algorithms/detail/overlay/handle_tangencies.hpp)
>
> The pattern that developed is "ix/xi".
>
> Will you know a correspondence method for this behavior?
> If there is advice, I am happy,
> and sorry for my english (not a native speaker. Therefore, I'm using a
> language translation service google.)
>
> Best Regards.
> h2
> _______________________________________________
> Geometry mailing list
> Geometry_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/geometry
>

-- 
Barend Gehrels
http://about.me/barendgehrels

Geometry list run by mateusz at loskot.net