mymesh.rays.RaysSurfIntersection#

mymesh.rays.RaysSurfIntersection(pts, rays, NodeCoords, SurfConn, bidirectional=True, eps=1e-14, Octree='generate')[source]#

Identify intersections between rays and a triangular surface mesh.

Parameters:
  • pts (array_like) – 3D point coordinates (shape = (m,3))

  • ray (array_like) – 3D vectors (shape = (m,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) – 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, octree.OctreeNode, or NoneType, optional) –

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

    • ’generate’ : Create an octree

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

    • octree.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.