resqpy.olio.vector_utilities.clockwise_triangles
- resqpy.olio.vector_utilities.clockwise_triangles(p, t, projection='xy')[source]
Returns a numpy array of +ve values where triangle points are in clockwise order, 0.0 if in line, -ve for ccw.
- 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 trianglesprojection (
string, default'xy') – one of ‘xy’, ‘xz’ or ‘yz’ being the direction of projection, ie. which elements of the second axis of p to use; must be ‘xy’ if p has shape (N, 2)
- Returns:
numpy float array of shape (M,) being the +ve or -ve values indicating clockwise or anti-clockwise ordering of each triangle’s vertices when projected onto the specified plane and viewed in the direction negative to positive of the omitted axis
Note
assumes xyz axes are left-handed (reverse the result for a right handed system)