UNPKG

@thi.ng/geom

Version:

Functional, polymorphic API for 2D geometry types & SVG generation

23 lines 722 B
import type { Maybe } from "@thi.ng/api"; import type { MultiFn2 } from "@thi.ng/defmulti"; import { type ReadonlyVec } from "@thi.ng/vectors/api"; import type { IShape } from "./api.js"; /** * Function overrides for {@link center}. */ export type CenterFn = { <T extends IShape>(shape: T, origin?: ReadonlyVec): Maybe<T>; } & MultiFn2<IShape, Maybe<ReadonlyVec>, Maybe<IShape>>; /** * Returns copy of given shape centered around optionally provided point `p` * (default: world space origin). * * @remarks * Implemented for all shape types supported by {@link centroid} and * {@link translate}. * * @param shape * @param origin */ export declare const center: CenterFn; //# sourceMappingURL=center.d.ts.map