resqpy.olio.intersection.poly_line_triangles_first_intersect

resqpy.olio.intersection.poly_line_triangles_first_intersect(line_ps, triangles, start=0)[source]

Finds the first intersection of a segment of an open poly-line with any of a set of triangles in 3D space.

Parameters
  • line_ps ((c, 3) numpy array) – ordered points on each of c-1 segments of a poly-line

  • triangles ((n, 3, 3) numpy array) – three corners of each of the n triangles (final index is xyz)

  • start (int, default 0) – the index of the point in line_ps to start searching from

Returns

(int, numpy float array of shape (3,)) where the int is the line segment index where one or more intersections were found and the floats are the xyz of one intersection of that line segment within the triangles; if no line segments intersect any of the trianges, (None, None) is returned

Note

this function is computationally and memory intensive; it could benefit from parallelisation