compute_qhull

Function compute_qhull 

Source
pub fn compute_qhull(points: &ArrayView2<'_, f64>) -> SpatialResult<ConvexHull>
Expand description

Compute convex hull using QHull algorithm

QHull is a robust library for computing convex hulls in arbitrary dimensions. This implementation handles various edge cases and provides fallbacks for degenerate cases.

§Arguments

  • points - Input points (shape: npoints x n_dim)

§Returns

  • Result containing a ConvexHull instance or an error

§Errors

  • Returns error if QHull computation fails
  • Falls back to special case handlers for small point sets

§Examples

use scirs2_spatial::convex_hull::algorithms::qhull::compute_qhull;
use scirs2_core::ndarray::array;

let points = array![[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [0.5, 0.5]];
let hull = compute_qhull(&points.view()).unwrap();
assert_eq!(hull.ndim(), 2);