resqpy.olio.vector_utilities.clockwise_sorted_indices(p, b)[source]

Returns a clockwise sorted numpy list of indices b into the points p.


this function is designed for preparing a list of points defining a convex polygon when projected in the xy plane, starting from a subset of the unsorted points; more specifically, it assumes that the mean of p (over axis 0) lies within the polygon and the clockwise ordering is relative to that mean point