Boost logo

Geometry :

Subject: [ggl] confused by point_order clockwise/counterclockwise
From: feverzsj
Date: 2011-04-14 12:25:38


hi, list
While wrting a function to check the ring/polygon orientation by using the
signed area algorithm, I also took a look at ggl's area function(with rings
always presumed clockwise). The ggl area() only returns negative area for
wrongly oriented ring with respect to the expected orientation, while the
signed area algorithm returns negative area for counterclockwise ring.

To my understanding, ggl algorithms are always based on "clockwise". So, in
the area() function, counterclockwise(determined by template parameter)
rings are reversed as clockwise. And also in many other scene. This seems
kinda different from the common computational geometry, which may bring some
surprising, and possibly better to be mentioned in the first place.

Furthermore, correct() is very useful, but the related dynamic check
utilites(like detect orientation, close/open) are not presented. Will it be
a good idea to provide them?

regards, zsj


Geometry list run by mateusz at loskot.net