Crate math_convex_hull

Crate math_convex_hull 

Source
Expand description

3D Convex Hull and Computational Geometry Library

This library implements the Quickhull algorithm for computing convex hulls in 3D space.

Based on the C implementation by Leo McCormack and the MATLAB Computational Geometry Toolbox.

§3D Convex Hull Example

use math_convex_hull::{ConvexHull3D, Vertex};

let vertices = vec![
    Vertex::new(0.0, 0.0, 0.0),
    Vertex::new(1.0, 0.0, 0.0),
    Vertex::new(0.0, 1.0, 0.0),
    Vertex::new(0.0, 0.0, 1.0),
];

let hull = ConvexHull3D::build(&vertices).unwrap();
println!("Number of faces: {}", hull.num_faces());

Modules§

testdata
Test data for convex hull tests

Structs§

ConvexHull3D
The result of a convex hull computation
Face
A face of the convex hull (triangle defined by 3 vertex indices)
Vertex
A 3D vertex/point

Enums§

ConvexHullError
Error types for convex hull operations

Functions§

export_html
Export a convex hull to HTML with Three.js visualization
export_obj
Export a convex hull to OBJ format

Type Aliases§

Result