pyblenderSDIC.meshes.TriangleMesh3D.open3d_cast_rays#

TriangleMesh3D.open3d_cast_rays(rays: ndarray) Dict[source]#

Calculate the intersection of rays with a given mesh using Open3D.

This method uses Open3D’s raycasting capabilities to find the intersection points of rays with the mesh.

# Define ray origins and directions
rays_origins = numpy.array([[0, 0, 0], [1, 1, 1]]) # shape (L, 3)
rays_directions = numpy.array([[0, 0, 1], [1, 1, 0]]) # shape (L, 3)
rays = numpy.hstack((rays_origins, rays_directions)) # shape (L, 6)

# Perform ray-mesh intersection
ray_intersect = trimesh3d.open3d_cast_rays(rays)
Parameters:

rays (numpy.ndarray) – A (…, 6) array of float32. Each component contains the position and the direction of a ray in the format [x0, y0, z0, dx, dy, dz].

Returns:

ray_intersect – The output of the raycasting operation by Open3D.

Return type:

Dict