pyblenderSDIC.meshes.TriangleMesh3D.calculate_intersect_coordinates#

TriangleMesh3D.calculate_intersect_coordinates(intersect_points: IntersectPoints) ndarray[source]#

Compute the 3D coordinates of intersection points from barycentric data.

This method reconstructs the 3D position of the intersection points using the barycentric coordinates and the triangle indices contained in the given IntersectPoints object.

intersect_points = trimesh3d.cast_rays(rays)
coords = trimesh3d.compute_intersect_points_coordinates(intersect_points)

Note

This method expects barycentric coordinates (u, v), with:

  • u: weight for vertex B

  • v: weight for vertex C

  • w = 1 - u - v: weight for vertex A

The corresponding 3D coordinates are computed as:

coordinates = w * A + u * B + v * C

Where A, B, and C are the vertices of the intersected triangle in the given frame.

Parameters:

intersect_points (IntersectPoints) – An object containing barycentric coordinates and triangle indices.

Returns:

An array of shape (…, 3) containing the 3D coordinates of the intersection points. Points with no intersection are returned as [nan, nan, nan].

Return type:

numpy.ndarray