// 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):