resqpy.olio.vector_utilities.points_in_triangles
- resqpy.olio.vector_utilities.points_in_triangles(p, t, da, projection='xy', edged=False)[source]
Returns 2D numpy bool array indicating which of points da are within which triangles.
- Parameters:
p (
numpy float arrayofshape (N,2or3)) – points in use as vertices of trianglest (
numpy int arrayofshape (M,3)) – indices into first axis of p defining the trianglesda (
numpy float arrayofshape (D,2or3)) – points to test forprojection (
string, default'xy') – one of ‘xy’, ‘xz’ or ‘yz’ being the direction of projection, ie. which elements of the second axis of p and da to use; must be ‘xy’ if p and da have shape (N, 2)edged (
bool, defaultFalse) – if True, points lying exactly on the edge of a triangle are included as being in the triangle, otherwise they are excluded
- Returns:
numpy bool array of shape (M, D) indicating which points are within which triangles
Note
the triangles do not need to be in a consistent clockwise or anti-clockwise order