resqpy.olio.intersection.triangles_for_line

resqpy.olio.intersection.triangles_for_line(line_set_intersections, line_index)[source]

From the result of line_set_triangles_intersects(), returns a list of intersected triangles for a line.

Parameters
  • line_set_intersections (numpy float array of shape (nl, nt, 3)) – where nl is the number of lines, nt is the number of triangles and the final axis is x,y,z; nan values indicate no intersection; this array is as returned by the line_set_triangles_intersects() function or the poly_line_triangles_intersects() function

  • line_index (integar) – the index of the line for which the intersected triangle list is required

Returns

(numpy 1D int array of size N, numpy 2D array of shape (N, 3))

the first of the pair of arrays

returned is a list of the triangle indices which the given line intersects; the second array is the list of corresponding intersection points (each x,y,z)

Notes

if the line does not intersect any triangles, both the resulting arrays will have size zero