Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Polygon] support for polygons with holes
From: Mika Heiskanen (mika.heiskanen_at_[hidden])
Date: 2011-09-13 13:11:37

On Tue, 2011-09-13 at 12:29 +0300, Björn Piltz wrote:
> 2011/9/8 Simonson, Lucanus J <lucanus.j.simonson_at_[hidden]>

> Björn Piltz wrote:
> >
> > 1.
> > Is there an easy(and computationally cheaper) way to check
> if two
> > simple polygons intersect?
> > other than: !boost::polygon::empty(a & b). If not, is such
> > functionality planned?
> You should check if their bounding boxes intersect first and
> then do the expensive check only if there is intersection
> between the bounding boxes.

Personally I would expect a good polygon library to provide a function
named intersects, which would implement an optimization like the one
mentioned above, plus specialized code which would interrupt polygon
intersection calculations as soon as one has been found.


Mika Heiskanen

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at