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

Sandro Santilli strk at keybit.net
Mon Sep 15 08:35:52 PDT 2014


On Mon, Sep 15, 2014 at 04:58:44PM +0200, Sandro Santilli wrote:
> On Mon, Sep 15, 2014 at 04:53:43PM +0200, Sandro Santilli wrote:
> > On Mon, Sep 15, 2014 at 04:12:04PM +0200, Sandro Santilli wrote:
> > > On Mon, Sep 15, 2014 at 03:16:16PM +0200, Sandro Santilli wrote:
> > > 
> > > > I wonder if the RectangleIntersection class should check winding order
> > > > and reverse rings if needed...
> > > 
> > > I've added a check for winding order in the rectangle clipping code.
> > > This adds one more full vertices scan for each hole. It doesn't look
> > > like code winding order would affect the algorithm, am I right ?
> > > 
> > > See commit 4ae01eb0711baac11c102a847b90952619379b0d
> > 
> > I was wrong, it was easy to find a case of failure with counterclockwise
> > shell. I'll add shell winding checking too. It'll add yet another full
> > vertex scan for the exterior ring, further degrading performances ...
> 
> Mika, do you think RectangleIntersectionBuilder::reconnectPolygons could
> accept an additional argument saying if the shell was CW or CCW ?
> That way we could skip the additional full scan of the shell whenever
> it is fully contained in the rectangle OR it fully contains it...

FYI: I've added such parameter to reconnectPolygons, if the shell is
clockwise, lines will be reversed. Seems to work fine.

 See commit 94238a220de2f64f8f4753652a7659107f77ea51

Test time again !

--strk; 

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


More information about the geos-devel mailing list