Boost logo

Geometry :

Subject: [ggl] Point orders of polygon
From: Barend Gehrels (barend)
Date: 2011-11-01 15:28:21


Hi,

On 31-10-2011 20:03, V D wrote:
> Hi,
>
> I'm a bit confused about the point order of polygons.
>
> My polygons are using the default argument, which is Clockwise=true
> Does that mean inner rings are also clockwise or are the inner rings always in the reverse direction?
>
> I tried the following:
>
>
>
> polygon square_with_hole;
> bg::read_wkt("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0), (3 3, 3 8, 8 8, 8 3, 3 3))", square_with_hole);
>
> // Here outer and inners[0] are both clockwise.
> bg::correct(square_with_hole);
> // Here outer is clockwise and inners[0] is counter-clockwise.
>

Interior rings are indeed in the reverse direction in a "correct" polygon.

Regards, Barend


Geometry list run by mateusz at loskot.net