import { Box3, Vector3 } from 'three'; import { ObjVec3, VectorObject3D } from './VectorUtils.js'; /** * Class that provides a set of utilities for calculating intersections between 2D and 3D geometric objects. */ export declare class IntersectionUtils { /** * Computes the intersection between two 2D lines defined by points `a1` and `a2`, and `b1` and `b2`. * * @param a1 - The first point of the first line. * @param a2 - The second point of the first line. * @param b1 - The first point of the second line. * @param b2 - The second point of the second line. * @param target - (Optional) The vector to store the intersection point. If omitted, a new vector will be created. * @returns The intersection point of the two lines or `undefined` if the lines are parallel. * * @see {@link https://paulbourke.net/geometry/pointlineplane/} */ static line_line_2D(a1: VectorObject3D, a2: VectorObject3D, b1: VectorObject3D, b2: VectorObject3D, target?: Vector3): Vector3; /** * Computes the intersection between two 2D line segments defined by points `a1` and `a2`, and `b1` and `b2`. * * @param a1 - The first point of the first segment. * @param a2 - The second point of the first segment. * @param b1 - The first point of the second segment. * @param b2 - The second point of the second segment. * @param target - (Optional) The vector to store the intersection point. If omitted, a new vector will be created. * @returns The intersection point of the two segments or `undefined` if the segments do not intersect. * * @see {@link https://paulbourke.net/geometry/pointlineplane/} */ static segment_segment_2D(a1: VectorObject3D, a2: VectorObject3D, b1: VectorObject3D, b2: VectorObject3D, target?: Vector3): Vector3; /** * Computes the intersection between two 3D lines defined by points `a1` and `a2`, and `b1` and `b2`. * * @param a1 - The first point of the first line. * @param a2 - The second point of the first line. * @param b1 - The first point of the second line. * @param b2 - The second point of the second line. * @param target - (Optional) The vector to store the intersection point. If omitted, a new vector will be created. * @param tolerance - (Optional) The tolerance for evaluating the intersection. The default value is 10^-6. * @returns The intersection point of the two lines or `undefined` if the lines are parallel or do not intersect. * * @see {@link https://paulbourke.net/geometry/pointlineplane/} */ static line_line_3D(a1: ObjVec3, a2: ObjVec3, b1: ObjVec3, b2: ObjVec3, target?: Vector3, tolerance?: number): Vector3; /** * Checks if a 3D line intersects an Axis-Aligned Bounding Box (AABB) defined by `box`. * * @param rayOrigin - The origin of the line. * @param rayDir - The direction of the line. * @param box - The AABB to check for intersection with. * @returns `true` if the line intersects the AABB, otherwise `false`. */ static line_boxAABB(rayOrigin: Vector3, rayDir: Vector3, box: Box3): boolean; /** * Checks if a 3D line segment defined by points `p1` and `p2` intersects an Axis-Aligned Bounding Box (AABB) defined by `box`. * * @param p1 - The first point of the segment. * @param p2 - The second point of the segment. * @param box - The AABB to check for intersection with. * @returns `true` if the segment intersects the AABB and is within the segment's length, otherwise `false`. */ static segment_boxAABB(p1: Vector3, p2: Vector3, box: Box3): boolean; } //# sourceMappingURL=IntersectionUtils.d.ts.map