import type { Either } from "@rickosborne/typical"; import type { Orientation, Polygon } from "./2d.js"; /** * Result of a calculation of whether a polygon is convex indicating * the polygon is complex. */ export type ConvexWithOrientation = { convex: true; orientation: Orientation.Counter | Orientation.Clockwise; }; /** * Result of a calculation of whether a polygon is convex, indicating * that it does not seem to be, or is still unknown. */ export type NotConvex = { badPoints?: number[]; convex: false; firstOrientation?: Orientation | undefined; overallOrientation?: Orientation | undefined; }; /** * Result of a calculation of whether a polygon is convex. */ export type IsConvex = Either; /** * Basic shared value for a true {@link IsConvex} result with a * clockwise orientation. */ export declare const CONVEX_TRUE_CW: IsConvex; /** * Basic shared value for a true {@link IsConvex} result with a * counterclockwise orientation. */ export declare const CONVEX_TRUE_CCW: IsConvex; /** * Performs a rudimentary check of a polygon, calculating angles at each * vertex and checking for sign flips in the line segment cross products. * The result may not be reliable for symmetric shapes where the signed * areas cancel out. This version also does not track "bad" points. */ export declare const fastIsConvex: (poly: Polygon) => boolean; /** * More detailed check to see if a polygon is convex. Tracks "bad" * points and returns them if found. Slower than {@link fastIsConvex}, * and doesn't necessarily return a better result, though it may give more * information in scenarios where you want to try to split the polygon * into smaller convex polygons. */ export declare const detailedIsConvex: (poly: Polygon) => IsConvex; //# sourceMappingURL=is-convex.d.ts.map