Skip to main content

Crate fast_mesh_store

Crate fast_mesh_store 

Source
Expand description

Editable triangle mesh storage with transactional undo/redo.

  • Mesh stores vertices, triangles and per-vertex channels in slots whose ids stay stable across edits, undo and redo.
  • Mesh::begin_edit opens a Transaction. Every write goes through it, and Transaction::commit returns a Patch holding only what changed.
  • History keeps patches within a memory budget and provides undo/redo.
  • Every commit, undo and redo reports a ChangeSet so that dependent data (BVHs, fields, render buffers) can update just the affected elements.

Structs§

Adjacency
Corner table of a Mesh: for every triangle corner, the corner across the opposite edge, plus one corner per vertex and a non-manifold flag per vertex.
AdjacencyBuild
A resumable build of a mesh’s Adjacency: the build of Mesh::ensure_adjacency cut into steps of a bounded number of elements (triangle or vertex slots), so that a caller can yield between them.
ChangeSet
What an edit, undo or redo changed. All lists are sorted and free of duplicates.
ChannelDesc
Describes a per-vertex attribute channel.
History
Undo/redo stacks of Patches for one mesh, limited by a memory budget.
Incidence
Every alive triangle using each vertex, stored in compressed rows.
IncidenceBuild
A resumable build of a mesh’s Incidence: the build of Mesh::ensure_incidence cut into steps of a bounded number of elements (triangle or vertex slots), so that a caller can yield between them.
Mesh
An editable triangle mesh stored in slots.
MeshBuilder
A Mesh built from flat buffers in steps, for callers that must yield between chunks of work (the Worker builds large meshes this way).
Patch
The recorded effect of one committed transaction. Re-apply it with Patch::apply (redo) or undo it with Patch::revert.
Remap
Old slot id → new id mapping produced by Mesh::compact.
Transaction
An open edit on a Mesh. All writes go through it.

Enums§

ChannelKind
Whether a channel’s values are undoable input or recomputable output.
EdgeKind
Kind of the edge opposite a corner.
PatchSide
Which slots of a Patch to release, see Patch::release.
PatchState
Whether an externally held Patch’s edit is currently applied to the mesh, see Mesh::release_patch_slots.
StoreError
Errors returned by mesh storage operations.
TopologyPolicy
How a source channel gets values for vertices created by an edit.

Constants§

UV_CHANNEL
Name of the UV channel: a source channel of 2 values per vertex slot, in the file’s own convention (glTF’s has v pointing down), interpolated for new vertices. Read it with crate::Mesh::uvs.

Type Aliases§

Result
TriangleId
Id of a triangle slot.
VertexId
Id of a vertex slot.