Boost logo

Geometry :

Subject: [ggl] Point/Box in Box Test (Border Cases - 3D)
From: Frank Glinka (glinkaf)
Date: 2011-06-29 07:02:55

Hi Barend,

thank you very much for the quick response and for the GGL library! :)

> Hi Frank,
> "within" should be (according to OGC) "completely within", so a point
> lying on a border, or a box touching a border, should return false.
> Internally, it is handled by a sort of "within code", returning 1 if
> within, 0 if on border, -1 if outside. This is not (yet) accessable to
> end users.
> So your question is not completely clear to me, "tests including border
> cases" means "tests returning true if on a border"?

I am searching a predicate slightly different than 'within' (don't
know the common term) such that expressions like:

  withinX(Box(Point(0,0,0), Point(1,1,1)),Box(Point(0,0,0), Point(2,2,2))

would be true. So using < or > for the comparisons of the boxes' edges
instead of <= or >= (in within.hpp:117). That wouldn't be equivalent to
"within(Box, Box) || onBorder(Box, Box)" in my understanding.

I had a look into the 'within_util.hpp' file with the within_code
function and it would be sufficient for point-in-box or point-in-ring
tests (although it is currently only prepared to work with 2D
points!?). But what about box-in-box or ring-in-ring use cases?

Best regards,

Geometry list run by mateusz at