Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polygonWind uses the wrong convention #48

Open
kimchirichie opened this issue Sep 23, 2024 · 0 comments
Open

polygonWind uses the wrong convention #48

kimchirichie opened this issue Sep 23, 2024 · 0 comments

Comments

@kimchirichie
Copy link

I was looking to use polygonWind to reorient my polygons to be right hand oriented. However there appears to be a mistake in the implementation which incorrectly interprets positive area as clockwise orientation.

const isClockwise = polygonArea(polygon, true) > 0;

The implementation here should be corrected to:

  var isClockwise = polygonArea(polygon, true) < 0;

Conventionally, counterclockwise nets a positive area & polygonArea is correctly implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant