mapbox-earcut provides Python bindings for the high-performance Mapbox Earcut C++ polygon triangulation library. It is currently at version 2.0.0 and sees active maintenance with releases addressing new Python versions and build system improvements.
pip install mapbox-earcutVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to triangulate a polygon with a hole using `mapbox_earcut.earcut`. The input is a NumPy array of 2D points, an array indicating the starting index of any holes, and the number of dimensions per point (typically 2).
Ensure you are using a version of `mapbox-earcut` that provides wheels for your specific Python major version. If pre-built wheels are not available, you may need to compile from source or upgrade/downgrade your Python environment.
Upgrade your Python environment to 3.9 or higher. If on 32-bit Linux, consider using an older version or compiling from source (which may be challenging due to NumPy dependencies).
Ensure your input `data` is a 2D NumPy array (e.g., `np.array([[x0,y0],[x1,y1],...])`). Correctly identify the starting point (index) for each hole within this array for the `hole_indices` parameter.
No dependency data recorded yet.