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
Discarding unused vertices makes earcut.hpp output unworkable for mapbox-gl-native due to the following:
Fill outlines use GL_LINES with indexed vertices
This requires knowing which vertex indexes correspond to which polygon rings
We want to share the same vertex indices with fill triangles
Therefore the indexes used by earcut need to correspond to the input vertex order -- no removal of vertices unused by triangulation
Once that's the case, then we are able to loop through the vertices in input order, add them to the buffer, and add the indices of ring vertices to the line elements buffer
The JS implementation does not remove unused vertices.
Yes, after I switched the JS implementation to indexed output, the output indices now reference the original input array. Unused vertices are a rare occurrence anyway, and reusing the input array makes performance better.
Discarding unused vertices makes earcut.hpp output unworkable for mapbox-gl-native due to the following:
GL_LINES
with indexed verticesThe JS implementation does not remove unused vertices.
cc @mourner @kkaefer to double check my logic.
The text was updated successfully, but these errors were encountered: