Skip to main content

fast_mesh_store/
lib.rs

1//! Editable triangle mesh storage with transactional undo/redo.
2//!
3//! - [`Mesh`] stores vertices, triangles and per-vertex channels in slots whose ids
4//!   stay stable across edits, undo and redo.
5//! - [`Mesh::begin_edit`] opens a [`Transaction`]. Every write goes through it, and
6//!   [`Transaction::commit`] returns a [`Patch`] holding only what changed.
7//! - [`History`] keeps patches within a memory budget and provides undo/redo.
8//! - Every commit, undo and redo reports a [`ChangeSet`] so that dependent data
9//!   (BVHs, fields, render buffers) can update just the affected elements.
10
11mod adjacency;
12mod channel;
13mod column;
14mod compact;
15mod error;
16mod history;
17mod incidence;
18mod mesh;
19#[doc(hidden)]
20pub mod par;
21mod patch;
22mod transaction;
23
24pub use adjacency::{Adjacency, AdjacencyBuild, EdgeKind};
25pub use channel::{ChannelDesc, ChannelKind, TopologyPolicy, UV_CHANNEL};
26pub use compact::Remap;
27pub use error::StoreError;
28pub use history::History;
29pub use incidence::{Incidence, IncidenceBuild};
30pub use mesh::{Mesh, MeshBuilder};
31pub use patch::{ChangeSet, Patch, PatchSide, PatchState};
32pub use transaction::Transaction;
33
34/// Id of a vertex slot.
35pub type VertexId = u32;
36/// Id of a triangle slot.
37pub type TriangleId = u32;
38
39pub type Result<T> = std::result::Result<T, StoreError>;