Skip to main content

Module hull_nd

Module hull_nd 

Source
Expand description

Convex hulls, Delaunay triangulations and Voronoi diagrams in any dimension, half-space intersections and Voronoi diagrams on the sphere, following scipy.spatial (which wraps Qhull): ConvexHullNd, DelaunayNd, VoronoiNd, HalfspaceIntersection and SphericalVoronoi.

Everything rests on one n-dimensional Quickhull (Barber, Dobkin and Huhdanpaa, 1996), the algorithm inside Qhull: start from a simplex, and repeatedly take the point farthest outside some facet, delete the facets it can see, and join it to the horizon. Delaunay triangulations are lower hulls of the points lifted to the paraboloid x_{d+1} = ‖x‖², Voronoi diagrams their duals, and half-space intersections hulls of the dual points.

See the book entry Geometry in any dimension.

Structs§

ConvexHullNd
The convex hull of points in any dimension d ≥ 2 (SciPy’s ConvexHull), with simplicial facets. Points within a small tolerance of a facet are treated as inside.
DelaunayNd
The Delaunay triangulation of points in any dimension d ≥ 2 (SciPy’s Delaunay): the lower facets of the hull of the points lifted to (x, ‖x‖²). Degenerate (cospherical) sets, such as grids, are triangulated by a tiny deterministic perturbation of the lifted coordinate, which picks one of their valid triangulations (Qhull’s “joggle”).
HalfspaceIntersection
The intersection of half-spaces A x + b ≤ 0 (SciPy’s HalfspaceIntersection), given a point strictly inside all of them: each half-space maps to the dual point aᵢ / −(aᵢ·c + bᵢ) (relative to the interior point c), each facet of the dual points’ convex hull to a vertex of the intersection.
QhullOptions
Options in the spirit of Qhull’s qhull_options string (SciPy’s qhull_options argument), for the subset that this implementation can honour. QhullOptions::parse reads a string:
SphericalVoronoi
The Voronoi diagram of points on a sphere in ℝ³ (SciPy’s SphericalVoronoi): the convex hull of the points is their Delaunay triangulation on the sphere, and each triangle’s circumcentre projected onto the sphere (its outward normal times the radius) is a Voronoi vertex. Regions are sorted counter-clockwise seen from outside.
VoronoiNd
The Voronoi diagram of points in any dimension (SciPy’s Voronoi), as the dual of the Delaunay triangulation: one Voronoi vertex per Delaunay simplex (its circumcentre), one region per input point, and one ridge per Delaunay edge (pair of neighbouring points).