mesh3d/
mesh3d.rs

1use parry3d::math::Vector;
2use parry3d::shape::TriMesh;
3
4fn main() {
5    let points = vec![
6        Vector::new(0.0, 1.0, 0.0),
7        Vector::new(-1.0, -0.5, 0.0),
8        Vector::new(0.0, -0.5, -1.0),
9        Vector::new(1.0, -0.5, 0.0),
10    ];
11
12    let indices = vec![[0u32, 1, 2], [0, 2, 3], [0, 3, 1]];
13
14    // Build the mesh.
15    let mesh = TriMesh::new(points, indices).unwrap();
16
17    assert!(mesh.vertices().len() == 4);
18}