basant307/AI_Governance_Project
045
1/** @template {ArrayLike<number>} T */2export default class Delaunator<T extends ArrayLike<number>> {3 /**4 * Constructs a delaunay triangulation object given an array of points (`[x, y]` by default).5 * `getX` and `getY` are optional functions of the form `(point) => value` for custom point formats.6 *7 * @template P8 * @param {P[]} points9 * @param {(p: P) => number} [getX]10 * @param {(p: P) => number} [getY]11 */12 static from<P>(points: P[], getX?: (p: P) => number, getY?: (p: P) => number): Delaunator<Float64Array<ArrayBuffer>>;13 /**14 * Constructs a delaunay triangulation object given an array of point coordinates of the form:15 * `[x0, y0, x1, y1, ...]` (use a typed array for best performance). Duplicate points are skipped.16 *17 * @param {T} coords18 */19 constructor(coords: T);20 coords: T;21 /** @private */ private _triangles;22 /** @private */ private _halfedges;23 /** @private */ private _hashSize;24 /** @private */ private _hullPrev;25 /** @private */ private _hullNext;26 /** @private */ private _hullTri;27 /** @private */ private _hullHash;28 /** @private */ private _ids;29 /** @private */ private _dists;30 /** @private */ private trianglesLen;31 /** @private */ private _cx;32 /** @private */ private _cy;33 /** @private */ private _hullStart;34 /** A `Uint32Array` array of indices that reference points on the convex hull of the input data, counter-clockwise. */35 hull: Uint32Array<ArrayBuffer>;36 /** A `Uint32Array` array of triangle vertex indices (each group of three numbers forms a triangle). All triangles are directed counterclockwise. */37 triangles: Uint32Array<ArrayBuffer>;38 /**39 * A `Int32Array` array of triangle half-edge indices that allows you to traverse the triangulation.40 * `i`-th half-edge in the array corresponds to vertex `triangles[i]` the half-edge is coming from.41 * `halfedges[i]` is the index of a twin half-edge in an adjacent triangle (or `-1` for outer half-edges on the convex hull).42 */43 halfedges: Int32Array<ArrayBuffer>;44 /**45 * Updates the triangulation if you modified `delaunay.coords` values in place, avoiding expensive memory allocations.46 * Useful for iterative relaxation algorithms such as Lloyd's.47 */48 update(): void;49 /**50 * Calculate an angle-based key for the edge hash used for advancing convex hull.51 *52 * @param {number} x53 * @param {number} y54 * @private55 */56 private _hashKey;57 /**58 * Flip an edge in a pair of triangles if it doesn't satisfy the Delaunay condition.59 *60 * @param {number} a61 * @private62 */63 private _legalize;64 /**65 * Link two half-edges to each other.66 * @param {number} a67 * @param {number} b68 * @private69 */70 private _link;71 /**72 * Add a new triangle given vertex indices and adjacent half-edge ids.73 *74 * @param {number} i075 * @param {number} i176 * @param {number} i277 * @param {number} a78 * @param {number} b79 * @param {number} c80 * @private81 */82 private _addTriangle;83}84 