intersectRay3d MethodStatic
Search facets for the first one that intersects the infinite line.
- To process all intersections, callers can supply an
options.acceptIntersection
callback that always returnsfalse
. In this case,intersectRay3d
will 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 afterintersectRay3d
returns, sort alongray
withmyIntersections.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.a is the intersection parameter on theray, e.g., zero at ray.origin and increasing in ray.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: 21 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.