You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm comparing some of the different triangulation libraries on opentype fonts, and have run into a strange issue with earcut that I can't solve. See the image below:
As you can see, the upper hole for the percent-sign is not correct with earcut.
Well, kinda hard to explain — the race condition was in the splitPolygon routine that splits the polygon into two parts if it can't find an ear to cut. In this particular case, it found a split diagonal which was invalid, cutting off the hole part of the ring instead of splitting the polygon into two.
Activity
dhowe commentedon Jul 8, 2015
More perplexing still, this only seems to happen after I've first rendered the p-character, as you can see below:
dhowe commentedon Jul 8, 2015
The data being input to the three libraries (correct and incorrect) are here:
[-]Strange issue with certain polygon/holes[/-][+]Strange issue triangulating certain polygons[/+]mourner commentedon Jul 8, 2015
OK seeing the issue, in the middle of debugging. Some weird race condition here.
dhowe commentedon Jul 8, 2015
thanks
mourner commentedon Jul 8, 2015
Should be fixed now! Published as 2.0.2. cc @kkaefer
dhowe commentedon Jul 8, 2015
Great, thanks -- do you mind explaining what the issue was? I looked into it a bit without success...
mourner commentedon Jul 8, 2015
Well, kinda hard to explain — the race condition was in the
splitPolygonroutine that splits the polygon into two parts if it can't find an ear to cut. In this particular case, it found a split diagonal which was invalid, cutting off the hole part of the ring instead of splitting the polygon into two.dhowe commentedon Jul 8, 2015
Thanks again for the quick fix...
Port fix for mapbox/earcut#29
Port fix for mapbox/earcut#29
Port fix for mapbox/earcut#29
Port fix for mapbox/earcut#29