import type { Pair } from "@thi.ng/api"; import { type BitField } from "@thi.ng/bitfield/bitfield"; import { type Edge } from "@thi.ng/quad-edge"; import { type ReadonlyVec, type Vec, type VecPair } from "@thi.ng/vectors/api"; export type Visitor = (e: Edge>, vistedEdges: BitField, visitedVerts: BitField) => void; export interface Vertex { pos: ReadonlyVec; id: number; val?: T; } export declare class DVMesh { first: Edge>; nextEID: number; nextVID: number; constructor(pts?: ReadonlyVec[] | Pair[], size?: number); /** * Adds a single new point `p` w/ optional value `val` to the mesh, unless * there already is another point existing within radius `eps`. If `update` * is true (default), the mesh dual will be automatically updated using * {@link DVMesh.computeDual}. * * @remarks * If adding multiple points, ensure `computeDual` will only be called * for/after the last point insertion to avoid computational overhead. * * @param p - * @param val - * @param eps - * @param update - */ add(p: ReadonlyVec, val?: T, eps?: number, update?: boolean): boolean; addKeys(pts: Iterable, eps?: number): void; addAll(pairs: Iterable>, eps?: number): void; /** * Returns tuple of the edge related to `p` and a boolean to indicate if * `p` already exists in this triangulation (true if already present). * * @param p - query point */ locate(p: ReadonlyVec, eps?: number): [Edge>, boolean]; /** * Syncronize / update / add dual faces (i.e. Voronoi) for current * primary mesh (i.e. Delaunay). */ computeDual(): void; delaunay(bounds?: ReadonlyVec[]): Vec[][]; /** * Advanced use only. Returns Delaunay triangles as arrays of raw * [thi.ng/quad-edge * Edges](https://docs.thi.ng/umbrella/quad-edge/classes/Edge.html). * * @remarks * The actual vertex position associated with each edge can be obtained via * `e.origin.pos`. Each edge (and each associated {@link Vertex}) also has a * unique ID, accessible via `e.id` and `e.origin.id`. */ delaunayQE(): Edge>[][]; voronoi(bounds?: ReadonlyVec[]): Vec[][]; /** * Advanced use only. Returns Voronoi cells as arrays of raw * [thi.ng/quad-edge * Edges](https://docs.thi.ng/umbrella/quad-edge/classes/Edge.html). * * @remarks * The actual vertex position associated with each edge can be obtained via * `e.origin.pos`. Each edge (and each associated {@link Vertex}) also has a * unique ID, accessible via `e.id` and `e.origin.id`. */ voronoiQE(): Edge>[][]; edges(voronoi?: boolean, boundsMinMax?: VecPair): VecPair[]; traverse(proc: Visitor, edges?: boolean, e?: Edge>): void; } //# sourceMappingURL=index.d.ts.map