convex3d/convex3d.rs
1use parry3d::math::Vector;
2use parry3d::shape::ConvexPolyhedron;
3
4fn main() {
5 let points = [
6 Vector::new(0.0f32, 0.0, 1.0),
7 Vector::new(0.0, 0.0, -1.0),
8 Vector::new(0.0, 1.0, 0.0),
9 Vector::new(0.0, -1.0, 0.0),
10 Vector::new(1.0, 0.0, 0.0),
11 Vector::new(-1.0, 0.0, 0.0),
12 Vector::ZERO,
13 ];
14
15 let convex = ConvexPolyhedron::from_convex_hull(&points).expect("Invalid convex shape.");
16 convex.check_geometry();
17}