@thi.ng/geom
Version:
Functional, polymorphic API for 2D geometry types & SVG generation
32 lines • 996 B
TypeScript
import type { Maybe } from "@thi.ng/api";
import type { MultiFn2 } from "@thi.ng/defmulti";
import type { ReadonlyVec } from "@thi.ng/vectors";
import type { IShape, IShape2, IShape3 } from "./api.js";
/**
* Function overrides for {@link splitNearPoint}.
*/
export type SplitNearPointFn = {
<T extends IShape2>(shape: T, p: ReadonlyVec): T[];
<T extends IShape3>(shape: T, p: ReadonlyVec): T[];
} & MultiFn2<IShape, ReadonlyVec, Maybe<IShape[]>>;
/**
* Similar to {@link splitAt}, but instead of taking a normalized parametric
* split position, splits the given curve at the closest point to `p`.
*
* @remarks
* Currently only implemented for:
*
* - {@link Cubic}
* - {@link Cubic3}
* - {@link Line}
* - {@link Line3}
* - {@link Polyline}
* - {@link Polyline3}
* - {@link Quadratic}
* - {@link Quadratic3}
*
* @param shape - shape to operate on
* @param p - split point
*/
export declare const splitNearPoint: SplitNearPointFn;
//# sourceMappingURL=split-near.d.ts.map