intersectRay3d Method
Compute the intersection of a line (parameterized as a ray) with the plane of this triangle.
- Intersection data is returned for the line-plane intersection.
- No intersection is returned if the line is parallel to the plane.
- As for the ray, it intersects this triangle if and only if the returned detail
dhasd.isValid === trueandd.a >= 0andd.isInsideOrOn === true. - This method is slower than
Ray3d.intersectionWithTrianglebut returns more information about the intersection.
intersectRay3d(ray: Ray3d, result?: TriangleLocationDetail): TriangleLocationDetail
@returns details d of the intersection point p of the line and the plane of this triangle:
d.isValid: false if and only ifray.directionis parallel to the plane, or the ray or triangle is degenerate.d.world: coordinates ofp.d.local: barycentric coordinates ofp.d.a: the intersection parameter ofpalong the ray. Negative meanspis behind the ray origin.d.classify: whereplies with respect to the triangle.d.isInsideOrOn: whetherpis inside or on the triangle.d.closestEdgeIndex: the index of the triangle edgeeonto whichpprojects.d.closestEdgeParam: the edge parameter at whichpprojects ontoe.- Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/RayTriangleIntersection
@see pointToFraction
| Parameter | Type | Description |
|---|---|---|
| ray | Ray3d | infinite line to intersect, as a ray |
| result | TriangleLocationDetail | optional pre-allocated object to fill and return |
Returns - TriangleLocationDetail
details d of the intersection point p of the line and the plane of this triangle:
d.isValid: false if and only ifray.directionis parallel to the plane, or the ray or triangle is degenerate.d.world: coordinates ofp.d.local: barycentric coordinates ofp.d.a: the intersection parameter ofpalong the ray. Negative meanspis behind the ray origin.d.classify: whereplies with respect to the triangle.d.isInsideOrOn: whetherpis inside or on the triangle.d.closestEdgeIndex: the index of the triangle edgeeonto whichpprojects.d.closestEdgeParam: the edge parameter at whichpprojects ontoe.- Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/RayTriangleIntersection
Defined in
- geometry3d/BarycentricTriangle.ts Line 528
Last Updated: 30 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.