Expand description
Editable triangle mesh storage with transactional undo/redo.
Meshstores vertices, triangles and per-vertex channels in slots whose ids stay stable across edits, undo and redo.Mesh::begin_editopens aTransaction. Every write goes through it, andTransaction::commitreturns aPatchholding only what changed.Historykeeps patches within a memory budget and provides undo/redo.- Every commit, undo and redo reports a
ChangeSetso 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. - Adjacency
Build - A resumable build of a mesh’s
Adjacency: the build ofMesh::ensure_adjacencycut into steps of a bounded number of elements (triangle or vertex slots), so that a caller can yield between them. - Change
Set - What an edit, undo or redo changed. All lists are sorted and free of duplicates.
- Channel
Desc - 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.
- Incidence
Build - A resumable build of a mesh’s
Incidence: the build ofMesh::ensure_incidencecut 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.
- Mesh
Builder - A
Meshbuilt 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 withPatch::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§
- Channel
Kind - Whether a channel’s values are undoable input or recomputable output.
- Edge
Kind - Kind of the edge opposite a corner.
- Patch
Side - Which slots of a
Patchto release, seePatch::release. - Patch
State - Whether an externally held
Patch’s edit is currently applied to the mesh, seeMesh::release_patch_slots. - Store
Error - Errors returned by mesh storage operations.
- Topology
Policy - 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
vpointing down), interpolated for new vertices. Read it withcrate::Mesh::uvs.
Type Aliases§
- Result
- Triangle
Id - Id of a triangle slot.
- Vertex
Id - Id of a vertex slot.