$ account mapbox
A header-only C++ library implementing the fast earclipping polygon triangulation algorithm, ported from the JavaScript earcut library. It provides a simple API (`mapbox::earcut`) that takes a polygon (with holes) and returns triangle indices, with an optional Delaunay refinement post-pass (`mapbox::refine`). The library is heavily optimized for real-time triangulation of vector tile geometries, using z-order curve hashing, custom memory allocation (object pool), and a block bounding-box index for efficient hole bridging. It targets C++14 for the public header and C++17 for tests/benchmarks. The repository also includes comprehensive test fixtures loaded at runtime from the upstream JS repository, benchmarks comparing against libtess2, and an interactive OpenGL visualizer.
This is a minimal Node.js library for converting geographic bounding boxes into centerpoint/zoom pairs for static map images, and vice versa. It wraps the @mapbox/sphericalmercator library to perform Mercator projection calculations, caching SphericalMercator instances by tile size and antimeridian flag for performance. The library exposes two functions: 'viewport' computes the center and zoom that best fits a bounding box within given pixel dimensions, and 'bounds' computes the bounding box from a centerpoint, zoom, and dimensions. It supports adjustable tile sizes (default 256) and optional float zooms. The code is well-structured and covered by tests, but the library is simple and does not contain independently reusable subcomponents. It is currently in a stale maintenance state with no recent updates.