// point_indices will have shape: (6N-12,)
point_indices = self._tri.simplices.ravel()
// indices will have shape: (6N-12,)
indices = np.argsort(point_indices, kind="mergesort")
// flattened_groups will have shape: (6N-12,)
flattened_groups = tri_indices[indices].astype(np.intp)
// intervals will have shape: (N+1,)
intervals = np.cumsum(np.bincount(point_indices + 1))
// split flattened groups to get nested list of unsorted regions
groups = [list(flattened_groups[intervals[i]:intervals[i + 1]])
for i in range(len(intervals) - 1)]
self.regions = groups
def sort_vertices_of_regions(self):
Sort indices of the vertices to be (counter-)clockwise ordered.