This module defines an index type that can be invalid, although it has the same size as
usize. This allows collections of usize integers to be reinterpreted as collections of
Index types.
For indexing into mesh topologies use types defined in the mesh::topology module.
A possibly invalid unsigned index.
The maximum usize integer represents an invalid index.
This index type is ideal for storage.
Overflow is not handled by this type. Instead we rely on Rust’s internal overflow panics during
debug builds.
The general structure of all types of mesh topologies is the mapping from one mesh component
(like a face) to another (like a vertex). One may implement any data layout convenient for them
but the interface shall remain the same.
In 3D a mesh can consist of:
cells (3D volumes),
faces (2D surfaces),
edges (1D curves) and
vertices (0D points)
Topology defines the mapping between each of these components
This trait identifies all indices that identify a particular element in a mesh, whether it is a
vertex or a triangle, or even a connectivity between triangles and vertices like a
triangle-vertex.
Plain old data trait. Types that implement this trait contain no references and can be copied
with memcpy. The additional Any trait lets us inspect the type more easily.
TopoIndex is an index for data at a point of connectivity. For instance a FaceVertexIndex
identifies a specific vertex pointed to by a face. This means it has a source and a
destination. This trait defines the indices for this source and destination indices.