Crate mesh_graph

Crate mesh_graph 

Source
Expand description

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 bevy Cargo feature
  • Good debugging using rerun Cargo 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

Connectivity

§Vertex

Connectivity

Modules§

integrations
primitives
utils

Macros§

error_none

Structs§

CircularHalfedgesIterator
Iterator over some halfedges
Face
FaceId
Halfedge
A directional edge that points from one vertex to another and is (optionally) part of a face. If it’s not part of a face, it’s called a boundary halfedge.
HalfedgeId
HashGrid
MeshGraph
Halfedge data structure for representing triangle meshes.
Polygon2
Polygon3
PolygonId
Selection
Vertex
A vertex is an corner point of a face.
VertexId

Enums§

PolygonTerminal

Traits§

SelectionOps

Functions§

plane_slice