Python version of Mapbox Earcut library: fast and quite robust triangulation of 2D polygons.
copied from cf-staging / mapbox_earcutThe library implements a modified ear slicing algorithm, optimized by z-order curve hashing and extended to handle holes, twisted polygons, degeneracies and self-intersections in a way that doesn't guarantee correctness of triangulation, but attempts to always produce acceptable results for practical data like geographical shapes.