resqpy.olio.vector_utilities.points_in_triangles_aligned_unified

resqpy.olio.vector_utilities.points_in_triangles_aligned_unified(nx: int, ny: int, ax: int, ay: int, az: int, triangles: ndarray, n_batches: int = 20) Tuple[ndarray, ndarray][source]

Calculates which points are within which triangles in 2D for a regular mesh of aligned points.

Parameters
  • nx (-) – number of points in x axis

  • ny (-) – number of points in y axis

  • ax (-) – ‘x’ axis selection (0, 1, or 2)

  • ay (-) – ‘y’ axis selection (0, 1, or 2)

  • az (-) – ‘z’ axis selection (0, 1, or 2)

  • triangles (-) – float array of each triangles’ normalised vertices in 3D, shape (N, 3, 3)

  • n_batches (-) – number of parallel batches

Returns

list like int array with each row being (tri number, axis ‘y’ int, axis ‘x’ int), and corresponding list like float array being axis ‘z’ sampled at point on triangle

Notes

  • actual axes to use for x, y, & z are determined by the ax, ay, & az arguments

  • 0, 1, & 2 must appear once each amongst the ax, ay, & az arguments

  • triangles points have already been normalised to a unit grid spacing and offset by half a cell

  • returned ‘z’ values are in normalised form

  • to denormalize ‘z’ values, add 0.5 and multiply by the actual cell length in the corresponding axis