chull
Documentation Convex hull approximation for rust based on Quick hull. Available in 3-D or 2-D for now.
Examples
use ConvexHull;
let p1 = vec!;
let p2 = vec!;
let p3 = vec!;
let p4 = vec!;
let p5 = vec!;
let p6 = vec!;
let p7 = vec!;
let p8 = vec!;
let p9 = vec!;
// threshold is used internally to determine whether a point is above or below the surface.
let threshold = 0.001;
let points = vec!;
let cube = try_new.unwrap;
assert_eq!;
let = cube.vertices_indices;
assert_eq!;
If the results are inaccurate
If the calculation results are inaccurate due to rounding errors, an error may occur. In such cases, the use of integer types such as i128
or BigDecimal
may improve the result.
use ConvexHull;
let p1 = vec!;
let p2 = vec!;
let p3 = vec!;
let p4 = vec!;
let p5 = vec!;
let p6 = vec!;
let points_float = vec!;
let mut points_i128 = Vec new;
for point_float in &points_float
let octahedron = try_new.unwrap;
// The following are likely to be errors
//let octahedron = ConvexHull::try_new(&points_float, std::f32::EPSILON, None).unwrap();
License: MIT/Apache-2.0