{ } Raw JSON

bundles / scipy 1.17.1 / scipy / spatial / _spherical_voronoi / SphericalVoronoi / sort_vertices_of_regions

function

scipy.spatial._spherical_voronoi:SphericalVoronoi.sort_vertices_of_regions

source: /scipy/spatial/_spherical_voronoi.py :231

Signature

def   sort_vertices_of_regions ( self )

Summary

Sort indices of the vertices to be (counter-)clockwise ordered.

Raises

: TypeError

If the points are not three-dimensional.

Notes

For each region in regions, it sorts the indices of the Voronoi vertices such that the resulting points are in a clockwise or counterclockwise order around the generator point.

This is done as follows: Recall that the n-th region in regions surrounds the n-th generator in points and that the k-th Voronoi vertex in vertices is the circumcenter of the k-th triangle in self._simplices. For each region n, we choose the first triangle (=Voronoi vertex) in self._simplices and a vertex of that triangle not equal to the center n. These determine a unique neighbor of that triangle, which is then chosen as the second triangle. The second triangle will have a unique vertex not equal to the current vertex or the center. This determines a unique neighbor of the second triangle, which is then chosen as the third triangle and so forth. We proceed through all the triangles (=Voronoi vertices) belonging to the generator in points and obtain a sorted version of the vertices of its surrounding region.

Aliases

  • scipy.spatial.SphericalVoronoi.sort_vertices_of_regions

Referenced by

This package