6 releases
Uses new Rust 2024
| 0.3.2 | Oct 15, 2025 |
|---|---|
| 0.3.1 | Oct 8, 2025 |
| 0.2.2 | Aug 22, 2025 |
| 0.2.1 | Jun 23, 2025 |
| 0.1.1 | May 15, 2025 |
#622 in Algorithms
Used in freestyle-sculpt
220KB
3K
SLoC
Mesh Graph
MeshGraph is a halfedge data structure for representing triangle meshes.
This is heavily inspired by SMesh and OpenMesh.
Features
- Fast spatial queries using parry3d's Bvh
- High performance using slotmap
- Easy integration with Bevy game engine using the
bevyCargo feature - Good debugging using
rerunCargo feature to enable the Rerun integration - Best in class documentation with illustrations
Usage
use mesh_graph::{MeshGraph, primitives::IcoSphere};
// Create a new mesh
let mesh_graph = MeshGraph::from(IcoSphere { radius: 10.0, subdivisions: 2 });
// Get some vertex ID and its vertex node
let (vertex_id, vertex) = mesh_graph.vertices.iter().next().unwrap();
// Iterate over all outgoing halfedges of the vertex
for halfedge_id in vertex.outgoing_halfedges(&mesh_graph) {
// do sth
}
// Get the position of the vertex
let position = mesh_graph.positions[vertex_id];
Check out the crate freestyle-sculpt for a heavy duty example.
Connectivity
Halfedge
Vertex
Dependencies
~15–57MB
~1M SLoC