[geos-devel] Geometry/Rectangle Intersection: winding order

Sandro Santilli strk at keybit.net
Tue Sep 16 00:54:21 PDT 2014


On Mon, Sep 15, 2014 at 09:19:32PM +0300, Mika Heiskanen wrote:
> On 09/15/2014 06:35 PM, Sandro Santilli wrote:

> >FYI: I've added such parameter to reconnectPolygons, if the shell is
> >clockwise, lines will be reversed. Seems to work fine.
> 
> Sorry, I couldn't keep up with you today.
> 
> The winding rule requirement was given in one of the algorithms I
> researched for implementing the rectangle clipper. If the shells
> are clockwise and the holes counter-clockwise, finding the next
> linestring by looking clockwise around the rectangle and checking
> the first vertex only will find the correct linestring to connect to
> and the linestring will be in the correct order. The extra boolean
> would indicate whether we need to compare the first or last vertex
> of the linestring when deciding which linestring to connect next.
> Sounds like you may have solved it already that way.

Uhm, given this description I might have not, as I'm only swapping
the order of line components and their vertices IFF the outer shell
is counterclockwise. If both the outer and the holes are clockwise 
there would be no reversing. Instead I understand there would need
to be a per-ring reordering of lines depending on the winding.

Will try today to add a test for such case. Thanks for the info.

--strk;

 ()  ASCII ribbon campaign  --  Keep it simple !
 /\  http://strk.keybit.net/rants/ascii_mails.txt  


More information about the geos-devel mailing list