mesh-graph 0.6.0

Fast halfedge triangle mesh graph in pure Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use glam::Vec3;

use crate::{MeshGraph, Vertex, VertexId};

impl MeshGraph {
    /// Inserts a vertex and it's position into the mesh graph.
    /// It doesn't do any connections.
    pub fn add_vertex(&mut self, position: Vec3) -> VertexId {
        let vertex = Vertex::default();
        let vertex_id = self.vertices.insert(vertex);
        self.positions.insert(vertex_id, position);

        self.outgoing_halfedges.insert(vertex_id, vec![]);

        vertex_id
    }
}