mymesh.rays.RaySurfIntersection#
- mymesh.rays.RaySurfIntersection(pt, ray, NodeCoords, SurfConn, eps=1e-14, Octree='generate')[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.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.