@thi.ng/geom
Version:
Functional, polymorphic API for 2D geometry types & SVG generation
36 lines • 992 B
TypeScript
import type { Maybe } from "@thi.ng/api";
import type { MultiFn2 } from "@thi.ng/defmulti";
import type { IShape, IShape2, IShape3 } from "./api.js";
import { Arc } from "./api/arc.js";
import type { Circle } from "./api/circle.js";
/**
* Function overrides for {@link splitAt}.
*/
export type SplitAtFn = {
(shape: Arc, t: number): [Arc, Arc];
(shape: Circle, t: number): [Arc, Arc];
<T extends IShape2>(shape: T, t: number): T[];
<T extends IShape3>(shape: T, t: number): T[];
} & MultiFn2<IShape, number, Maybe<IShape[]>>;
/**
* Splits given shape in 2 parts at normalized parametric position `t`.
*
* @remarks
* Currently only implemented for:
*
* - {@link Arc}
* - {@link Circle}
* - {@link Cubic}
* - {@link Cubic3}
* - {@link Line}
* - {@link Line3}
* - {@link Polyline}
* - {@link Polyline3}
* - {@link Quadratic}
* - {@link Quadratic3}
*
* @param shape
* @param t
*/
export declare const splitAt: SplitAtFn;
//# sourceMappingURL=split-at.d.ts.map