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 returns false. In this case,intersectRay3d
will return undefined, 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: Polyface | PolyfaceVisitor, ray: Ray3d, options?: FacetIntersectOptions): undefined | FacetLocationDetail
Parameter | Type | Description |
---|---|---|
visitor | Polyface | PolyfaceVisitor | facet iterator |
ray | Ray3d | infinite line parameterized as a ray. The returned detail.a is the intersection parameter on the ray, 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 1372
Last Updated: 20 June, 2023