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

Infinite loop from triangulatePolygon2 #2

Open
joshuahhh opened this issue Jul 2, 2018 · 1 comment
Open

Infinite loop from triangulatePolygon2 #2

joshuahhh opened this issue Jul 2, 2018 · 1 comment

Comments

@joshuahhh
Copy link

The following code hangs in an infinite loop:

const cga = require("cga")
cga.triangulatePolygon2([[392,114],[216,179],[159,295],[215,267]])

As far as I know, this is a pretty normal polygon:

screen shot 2018-07-02 at 2 24 50 am

I'm not sure what's going on.

@joshuahhh
Copy link
Author

The problem is that the ears array is all false. Reversing the order of the vertices makes the function work. I guess that means cga requires a certain orientation for the polygon.

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