resqpy.olio.intersection.line_set_triangles_intersects

resqpy.olio.intersection.line_set_triangles_intersects(line_ps, line_vs, triangles, line_segment=False)[source]

Find the intersections of each of set of lines within each of a set of triangles in 3D space.

Parameters:
  • line_ps ((c, 3) numpy array) – a point on each of c lines

  • line_vs ((c, 3) numpy array) – vectors being the direction of each of the c lines

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

  • line_segment (boolean, default False) – if True, each line is treated as a finite segment between p and p + v, and only intersections within the segment are included

Returns:

points ((c, n, 3) numpy array) of intersections of the lines within the triangles, (nan, nan, nan) where a line is parallel to plane of triangle or intersection with the plane is outside the triangle

Note

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