@thi.ng/geom
Version:
Functional, polymorphic API for 2D geometry types & SVG generation
34 lines • 915 B
TypeScript
import type { MultiFn1 } from "@thi.ng/defmulti";
import type { IShape, IShape2 } from "./api.js";
import { Polygon } from "./api/polygon.js";
/**
* Function overrides for {@link convexHull}.
*/
export type ConvexHullFn = {
(shape: IShape2): Polygon;
} & MultiFn1<IShape, IShape>;
/**
* Computes the convex hull for given shape and returns it as {@link Polygon}.
*
* @remarks
* Internally uses
* [`grahamScan2`](https://docs.thi.ng/umbrella/geom-hull/functions/grahamScan2.html).
*
* Currently implemented for:
*
* - {@link Arc}
* - {@link Circle}
* - {@link ComplexPolygon}
* - {@link Ellipse}
* - {@link Group} (only the listed child shape types are considered)
* - {@link Points}
* - {@link Polygon}
* - {@link Polyline}
* - {@link Quad}
* - {@link Rect}
* - {@link Triangle}
*
* @param shape
*/
export declare const convexHull: ConvexHullFn;
//# sourceMappingURL=convex-hull.d.ts.map