On Tue, 2011-09-13 at 12:29 +0300, Björn Piltz wrote:
2011/9/8 Simonson, Lucanus J
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. Regards, Mika Heiskanen