/** * Convex hull — the foundation of the computational-geometry engine. * * `convexHull` accepts a set of 2-D or 3-D points and returns a structured * result (`vertices`, `simplices`, `area`, `volume`) whose fields mirror * `scipy.spatial.ConvexHull`: * * - **2-D:** Andrew's monotone-chain algorithm (O(n log n)). `vertices` are the * indices of the hull points in counter-clockwise order; `simplices` are the * boundary edges (index pairs); `area` is the **perimeter** and `volume` is * the **enclosed area** (matching SciPy's `.area` / `.volume` convention in * 2-D). * - **3-D:** incremental QuickHull (reusing the package's `convexHull3D` * kernel). `simplices` are the triangular facets (index triples, oriented CCW * as seen from outside); `area` is the **surface area** and `volume` the * enclosed **volume**. * * Pinned against `scipy.spatial.ConvexHull` (vertex set + area/volume) in * `functions/tests/geometry-hull-oracle.test.ts`. * * @packageDocumentation */ /** Structured convex-hull result (mirrors `scipy.spatial.ConvexHull`). */ export interface ConvexHullResult { /** * Indices of the input points that lie on the hull. In 2-D these are in * counter-clockwise order; in 3-D they are sorted ascending. */ vertices: number[]; /** * Hull facets as arrays of point indices: edges `[i, j]` in 2-D, triangles * `[i, j, k]` in 3-D (CCW from outside). */ simplices: number[][]; /** SciPy `.area`: **perimeter** in 2-D, **surface area** in 3-D. */ area: number; /** SciPy `.volume`: **enclosed area** in 2-D, **enclosed volume** in 3-D. */ volume: number; } /** * Convex hull of a set of 2-D or 3-D points. * * @param points - Array of points, all `[x, y]` (2-D) or all `[x, y, z]` (3-D). * @returns A {@link ConvexHullResult}. * @throws When fewer than 3 (2-D) / 4 (3-D) points are given, or the points are * not 2- or 3-dimensional. * * @example * convexHull([[0,0],[2,0],[2,2],[0,2],[1,1]]) * // { vertices: [0,1,2,3], simplices: [[0,1],[1,2],[2,3],[3,0]], area: 8, volume: 4 } */ export declare function convexHull(points: number[][]): ConvexHullResult; //# sourceMappingURL=hull.d.ts.map