WD-DALI-1.1 polygon winding direction

Felix Stoehr fstoehr at eso.org
Thu Sep 8 07:49:56 CEST 2016


Hi Pat,

This is just to let you know that the footprintfinder.py has chosen the
opposite. Polygons: clockwise, holes: counterclockwise.

I remember that back in 2008 when I wrote that code, I had looked around
what others do but can't recall what made me pick the direction then. I
remember having looked at OpenGL but checking now, their default seems
to be as yours.

ESRI use the same definition I do:
http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf

And HTML5 canvas seems to be the same:
http://stackoverflow.com/questions/13618844/polygon-with-a-hole-in-the-middle-with-html5s-canvas

But then, others seem to be different:
https://www.opengl.org/sdk/docs/man2/xhtml/glFrontFace.xml
http://blog.thematicmapping.org/2008/08/why-direction-of-polygon-coordinates-in.html

If the polygon winding direction is as you have modified, then all MAST,
ESA and ALMA footprints will have to be reversed and - worse - I'll have
to change a line of my code ;-)

Best regards,

Felix

On 09/07/2016 07:31 PM, Patrick Dowler wrote:
> As agreed in Stellenbosch, I have just committed rev 3530 specifying
> that polygon winding direction is counter-clockwise. I chose that
> because the simple sort of algorithms to compute area are positive for
> CCW and negative for CW and I instinctively draw polygons that way.
> 
> The diff is here:
> 
> https://volute.g-vo.org/viewvc/volute/trunk/projects/dal/DALI/DALI.tex?r1=3406&r2=3530


More information about the dal mailing list