@thi.ng/geom
Version:
Functional, polymorphic API for 2D geometry types & SVG generation
49 lines • 1.68 kB
TypeScript
import type { MultiFn2O } from "@thi.ng/defmulti";
import { type IShape, type IntersectionResult } from "./api.js";
export interface IntersectOpts {
/**
* Force returning all intersections, if possible (and supported).
*/
all: boolean;
}
/**
* Performs intersection tests on given 2 shapes and returns
* [`IntersectionResult`](https://docs.thi.ng/umbrella/geom-isec/interfaces/IntersectionResult.html).
*
* @remarks
* Currently supported pairs:
*
* - {@link AABB} / {@link AABB}
* - {@link Circle} / {@link Circle}
* - {@link Line} / {@link Group}
* - {@link Line} / {@link Line}
* - {@link Line} / {@link Polygon}
* - {@link Line} / {@link Polyline}
* - {@link Plane} / {@link Plane}
* - {@link Ray} / {@link AABB}
* - {@link Ray} / {@link Circle}
* - {@link Ray} / {@link Line}
* - {@link Ray3} / {@link Plane}
* - {@link Ray} / {@link Polygon}
* - {@link Ray} / {@link Polyline}
* - {@link Ray} / {@link Quad}
* - {@link Ray} / {@link Rect}
* - {@link Ray3} / {@link Sphere}
* - {@link Ray} / {@link Triangle}
* - {@link Rect} / {@link Rect}
* - {@link Sphere} / {@link Sphere}
*
* If {@link IntersectOpts.all} is enabled (default: false) and if the
* intersection pair supports it, all possible intersections will be returned
* (for some implementations this always the case anyway). Currently, this is
* option is only implemented for the following pairings:
*
* - {@link Ray} / {@link Polygon}
* - {@link Ray} / {@link Polyline}
*
* @param a
* @param b
* @param opts
*/
export declare const intersects: MultiFn2O<IShape, IShape, Partial<IntersectOpts>, IntersectionResult>;
//# sourceMappingURL=intersects.d.ts.map