intersectRay3d MethodStatic
Search facets for the first one that intersects the infinite line.
- To process all intersections, callers can supply an options.acceptIntersectioncallback that always returnsfalse. In this case,intersectRay3dwill returnundefined, but the callback will be invoked for each intersection.
- Example callback logic:- Accept the first found facet that intersects the half-line specified by the ray: return detail.a >= 0.0;
- Collect all intersections: myIntersections.push(detail.clone()); return false;Then afterintersectRay3dreturns, sort alongraywithmyIntersections.sort((d0, d1) => d0.a - d1.a);
 
- Accept the first found facet that intersects the half-line specified by the ray: 
intersectRay3d(visitor: PolyfaceVisitor | Polyface, ray: Ray3d, options?: FacetIntersectOptions): undefined | FacetLocationDetail
@returns  detail for the (accepted) intersection with detail.IsInsideOrOn === true, or undefined if no
(accepted) intersection.
@see intersectRay3d
| Parameter | Type | Description | 
|---|---|---|
| visitor | PolyfaceVisitor | Polyface | facet iterator. | 
| ray | Ray3d | infinite line parameterized as a ray. The returned detail.ais the intersection parameter on theray, e.g., zero at ray.originand increasing inray.direction. | 
| options | FacetIntersectOptions | options for computing and populating an intersection detail, and an optional callback for accepting one. | 
Returns - undefined | FacetLocationDetail
detail for the (accepted) intersection with detail.IsInsideOrOn === true, or undefined if no
(accepted) intersection.
Defined in
- polyface/PolyfaceQuery.ts Line 2001
Last Updated: 24 June, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.