A triangle mesh data structure including basic operations.
Why another triangle mesh data structure crate you might ask.
Well, if you want a more feature complete crate than halfedgemesh and a less generic crate than plexus,
then tri-mesh
is probably something for you!
toml
[dependencies]
tri-mesh = "0.1.0"
Please, see the documentation for more details.
```rust use tri_mesh::prelude::*;
fn main() {
// Construct a mesh from positions and indices
let indices: Vec
// Compute the extreme coordinates..
let mut min_coordinates = vec3(std::f32::MAX, std::f32::MAX, std::f32::MAX);
let mut max_coordinates = vec3(std::f32::MIN, std::f32::MIN, std::f32::MIN);
for vertex_id in mesh.vertex_iter()
{
let position = mesh.vertex_position(vertex_id);
for i in 0..3 {
min_coordinates[i] = min_coordinates[i].min(position[i]);
max_coordinates[i] = max_coordinates[i].max(position[i]);
}
}
// .. or use the built-in method
let (min_coordinates, max_coordinates) = mesh.extreme_coordinates();
} ```
Please, see the documentation for more examples.