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

Triangulation - wrong output? #136

Open
RARgames opened this issue Apr 24, 2020 · 0 comments
Open

Triangulation - wrong output? #136

RARgames opened this issue Apr 24, 2020 · 0 comments
Labels

Comments

@RARgames
Copy link

After executing earcut([1, 1, 5, 1, 5, 5, 1, 5, 2,2, 3,2, 3,3, 2,3, 4,4, 5,4, 5,5, 4,5, 4,3, 5,3, 5,4, 4,4, 4,2, 5,2, 5,3, 4,3, 2,1, 3,1, 3,2, 2,2], [4, 8, 12, 16, 20]);

the result is:

Output
0: 01: 202: 233: 224: 215: 16: 177: 228: 19: 310: 011: 412: 613: 514: 1615: 316: 417: 718: 619: 1620: 1921: 722: 1223: 1524: 925: 826: 727: 728: 829: 1130: 331: 732: 1533: 1534: 1435: 236: 237: 338: 15
​
length: 39

image
From above table we can see that triangles marked red: 9,12,13 are wrong - because they overlap the 2nd hole.
Also triangle 11 is overlapping triangle 10.

Is my input data correct?
I'd like to achieve something like this:
image

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

No branches or pull requests

2 participants