resqpy.olio.vector_utilities.points_in_triangles_aligned_optimised_old
- resqpy.olio.vector_utilities.points_in_triangles_aligned_optimised_old(nx: int, ny: int, dx: float, dy: float, triangles: ndarray) ndarray[source]
Calculates which points are within which triangles in 2D for a regular mesh of aligned points.
- Parameters:
nx (
int) – number of points in x axisny (
int) – number of points in y axisdx (
float) – spacing of points in x axis (first point is at half dx)dy (
float) – spacing of points in y axis (first point is at half dy)triangles (
np.ndarray) – float array of each triangles’ vertices in 2D, shape (N, 3, 2)
- Returns:
triangles_points (np.ndarray) –
- 2D array (list-like) containing only the points within each triangle,
with each row being the triangle number, points y index, and points x index