intersectRay3d Method

Compute the intersection of a line (parameterized as a ray) with the plane of this triangle.

  • This method is slower than Ray3d.intersectionWithTriangle.

intersectRay3d(ray: Ray3d, result?: TriangleLocationDetail): TriangleLocationDetail

@returns details d of the line-plane intersection point d.world:

  • d.a is the intersection parameter along the ray.
  • The line intersects the plane of the triangle if and only if d.isValid returns true.
  • The ray intersects the plane of the triangle if and only if d.isValid returns true and d.a >= 0.
  • The ray intersects the triangle if and only if d.isValid returns true, d.a >= 0, and d.isInsideOrOn returns true.
  • d.classify can be used to determine where the intersection lies with respect to the triangle.
  • 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 line-plane intersection point d.world:

  • d.a is the intersection parameter along the ray.
  • The line intersects the plane of the triangle if and only if d.isValid returns true.
  • The ray intersects the plane of the triangle if and only if d.isValid returns true and d.a >= 0.
  • The ray intersects the triangle if and only if d.isValid returns true, d.a >= 0, and d.isInsideOrOn returns true.
  • d.classify can be used to determine where the intersection lies with respect to the triangle.
  • Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/RayTriangleIntersection

Defined in

Last Updated: 21 November, 2024