Boost logo

Geometry :

Subject: [ggl] Re: within() to return true if point is on border?
From: Denis Pesotsky (obey)
Date: 2011-04-10 20:51:04


Dirty solution: http://paste.kde.org/10392/
It works well, but slower that it could. Any nicer way?

2011/4/11 Denis Pesotsky <obey_at_[hidden]>:
> boost::geometry::intersects(rect, polygon) is not good for me.
>
> Look @ attached screenshots, first is initial (white thingies are
> rectangles, big thing is polygon -- rectangular outer ring and 1
> rectangular hole) and second is after removing each rectangles that
> are not intersected by polygon (e.g. boost::geometry::intersects(rect,
> polygon) for it returns false).
>
>
> 2011/4/11 Denis Pesotsky <obey_at_[hidden]>:
>> Hi all.
>>
>> I need to detect if polygon (with holes) intersects box. Intersection
>> is when they have shared square (e.g. intersection square > 0).
>>
>> Currently, I do following: http://paste.kde.org/10360/
>>
>> First funcion returns true, if box intersects ring.
>> Second function (should) return true, if box is fully contained by
>> ring (if some corner of box is on border, it still can return true).
>> Third function (should) return true if box intersects (1st function)
>> outer ring of polygon and is not contained (2nd function) by any inner
>> ring of polygon.
>>
>> Second function result is bad for me, I need within() to return true
>> if point is on border. Any way to do that? Or maybe I need to do
>> something else?
>>
>


Geometry list run by mateusz at loskot.net