mymesh.rays.RaySurfIntersection#

mymesh.rays.RaySurfIntersection(pt, ray, NodeCoords, SurfConn, bidirectional=True, eps=1e-14, Octree=None)[source]#

Identify intersections between a ray and a triangular surface mesh.

Parameters:
  • pt (array_like) – 3D point coordinate (shape = (3,))

  • ray (array_like) – 3D vector (shape = (3,))

  • NodeCoords (array_like) – nx3 list of node coordinates

  • SurfConn (array_like) – List of surface element connectivities. This should be a strictly triangular mesh. See surf2tris() for conversion.

  • bidirectional (bool, optional) – Determines whether to check for intersections only in the direction the ray is pointing, or in both directions (±ray), by default False.

  • eps (float, optional) – Small tolerance parameter, by default 1e-14

  • Octree (str, tree.OctreeNode, or NoneType, optional) –

    Specify whether to use an octree structure for acceleration of intersection tests. An octree previously contructed using Surface2Octree() can be used, or one can be generated by default None.

    • ’generate’ : Create an octree

    • ’None’ or None : Don’t use an octree

    • tree.OctreeNode : Use this octree

Returns:

  • intersections (np.ndarray) – Indices of triangles that are intersected by ray.

  • distances (np.ndarray) – Distances between the point and the intersection point.

  • intersectionPts (np.ndarray) – Coordinates of intersection points for each intersection.