@thi.ng/geom
Version:
Functional, polymorphic API for 2D geometry types & SVG generation
102 lines • 4.51 kB
TypeScript
import type { MultiFn2O } from "@thi.ng/defmulti";
import { BasicTessellation, MeshTessellation } from "@thi.ng/geom-tessellate/tessellation";
import type { IShape, ITessellation, Tessellator } from "./api.js";
/**
* Iteratively tessellates shape using provided
* [`Tessellator`](https://docs.thi.ng/umbrella/geom-tessellate/types/Tessellator.html)
* functions and optional
* [`ITessellation`](https://docs.thi.ng/umbrella/geom-tessellate/interfaces/ITessellation.html)
* impl. See [thi.ng/geom-tessellate](https://thi.ng/thi.ng/geom-tessellate)
* package for more details.
*
* @remarks
* Implemented for all shapes supported by {@link vertices}. For groups, every
* child shape will be tessellated individually, but results combined into a
* single
* [`ITessellation`](https://docs.thi.ng/umbrella/geom-tessellate/interfaces/ITessellation.html)
* instance.
*
* {@link ComplexPolygon}s will **always** be first tessellated via
* {@link TESSELLATE_EARCUT_COMPLEX} as a first pass (so you don't need to
* specify that one). This is currently the only tessellation method considering
* holes and is also recommended as first pass for concave polygons.
*
* If `tess` is not given, a {@link basicTessellation} will be used as default.
*
* The following tessellator presets are available:
*
* - {@link TESSELLATE_EARCUT}
* - {@link TESSELLATE_EARCUT_COMPLEX}
* - {@link TESSELLATE_EDGE_SPLIT}
* - {@link TESSELLATE_INSET}
* - {@link TESSELLATE_QUAD_FAN}
* - {@link TESSELLATE_RIM_TRIS}
* - {@link TESSELLATE_TRI_FAN}
* - {@link TESSELLATE_TRI_FAN_BOUNDARY}
* - {@link TESSELLATE_TRI_FAN_SPLIT}
*
* @param shape
* @param tessellators
* @param tess
*/
export declare const tessellate: MultiFn2O<IShape, Iterable<Tessellator>, ITessellation, ITessellation>;
/**
* Alias for thi.ng/geom-tessellate
* [`earCut`](https://docs.thi.ng/umbrella/geom-tessellate/functions/earCut.html)
*/
export declare const TESSELLATE_EARCUT: import("@thi.ng/geom-tessellate").Tessellator;
/**
* Higher-order tessellator. Alias for thi.ng/geom-tessellate
* [`earCut`](https://docs.thi.ng/umbrella/geom-tessellate/functions/earCut.html)
*/
export declare const TESSELLATE_EARCUT_COMPLEX: (holeIDs?: number[], hashThreshold?: number) => import("@thi.ng/geom-tessellate").Tessellator;
/**
* Alias for thi.ng/geom-tessellate
* [`edgeSplit`](https://docs.thi.ng/umbrella/geom-tessellate/functions/edgeSplit.html)
*/
export declare const TESSELLATE_EDGE_SPLIT: import("@thi.ng/geom-tessellate").Tessellator;
/**
* Alias for thi.ng/geom-tessellate
* [`inset`](https://docs.thi.ng/umbrella/geom-tessellate/functions/inset.html)
*/
export declare const TESSELLATE_INSET: (inset?: number, keepInterior?: boolean) => import("@thi.ng/geom-tessellate").Tessellator;
/**
* Alias for thi.ng/geom-tessellate
* [`quadFan`](https://docs.thi.ng/umbrella/geom-tessellate/functions/quadFan.html)
*/
export declare const TESSELLATE_QUAD_FAN: import("@thi.ng/geom-tessellate").Tessellator;
/**
* Alias for thi.ng/geom-tessellate
* [`rimTris`](https://docs.thi.ng/umbrella/geom-tessellate/functions/rimTris.html)
*/
export declare const TESSELLATE_RIM_TRIS: import("@thi.ng/geom-tessellate").Tessellator;
/**
* Alias for thi.ng/geom-tessellate
* [`triFan`](https://docs.thi.ng/umbrella/geom-tessellate/functions/triFan.html)
*/
export declare const TESSELLATE_TRI_FAN: import("@thi.ng/geom-tessellate").Tessellator;
/**
* Alias for thi.ng/geom-tessellate
* [`triFanBoundary`](https://docs.thi.ng/umbrella/geom-tessellate/functions/triFanBoundary.html)
*/
export declare const TESSELLATE_TRI_FAN_BOUNDARY: import("@thi.ng/geom-tessellate").Tessellator;
/**
* Alias for thi.ng/geom-tessellate
* [`triFanSplit`](https://docs.thi.ng/umbrella/geom-tessellate/functions/triFanSplit.html)
*/
export declare const TESSELLATE_TRI_FAN_SPLIT: import("@thi.ng/geom-tessellate").Tessellator;
/**
* Syntax sugar for creating a thi.ng/geom-tessellate
* [`BasicTessellation`](https://docs.thi.ng/umbrella/geom-tessellate/classes/BasicTessellation.html).
*/
export declare const basicTessellation: () => BasicTessellation;
/**
* Syntax sugar for creating a new thi.ng/geom-tessellate
* [`MeshTessellation`](https://docs.thi.ng/umbrella/geom-tessellate/classes/MeshTessellation.html)
* for 2D or 3D geometry and vertex welding tolerance/distance `eps`
*
* @param dim
* @param eps
*/
export declare const meshTessellation: (dim: 2 | 3, eps?: number) => MeshTessellation;
//# sourceMappingURL=tessellate.d.ts.map