resqpy.olio.intersection.lines_for_triangle

resqpy.olio.intersection.lines_for_triangle(line_set_intersections, triangle_index)[source]

From the result of line_set_triangles_intersects(), returns a list of lines intersecing given triangle.

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

  • triangle_index (integar) – the index of the triangle for which the intersecting line 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 indices of lines which intersect with the given triangle; the second array is the list of corresponding intersection points (each x,y,z)

Notes

if no lines intersect the triangle, both the resulting arrays will have size zero