Boost logo

Geometry :

Subject: Re: [geometry] Trouble with polygon/box intersection when polygon/box point types are different
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2016-06-07 11:44:08


Gratton, Michael wrote:
> I'm trying to adapt polygons using Eigen::Vector2d point types (http://eigen.tuxfamily.org) for use with boost::geometry. Things mostly work great, but the rtree implementation uses the internal boost::geometry box type, and I get errors when attempting to intersect my Eigen polygon with the internal box.
>
> I made a small program to isolate the compilation error I get:

<snip>

> then everything builds and works. Looking inside, it looks like the later makes copies of the four points, storing them in the point type of the first segment type. So this change would be a bit of a performance hit compared to what is already there.
>
> Is this a bug or am I mixing something up with my custom polygon type?

I prepared a fix for this issue:
https://github.com/boostorg/geometry/pull/351

Could you check if it works for you?
You could either checkout the branch with the fix from my repo or simply
copy this file into your local copy of Boost.Geometry:
https://github.com/awulkiew/geometry/blob/ccd671f5aca5813ac7ffc2494438182ad281c807/include/boost/geometry/strategies/cartesian/cart_intersect.hpp

Regards,
Adam



Geometry list run by mateusz at loskot.net