-
Notifications
You must be signed in to change notification settings - Fork 6
Mesh Implementations Data Structures
There are many different ways to implement/store a mesh. These different implementations have different characteristics in terms of:
- What neighborhood information can I obtain in constant time
- Memory usage
- Speed/cache friendliness
- What elements (face, edge, vertex) are "explicitly" stored = can be referred to
A table showing all this data can be found here. The different data structures will be briefly explained here.
I call these week because they have a very limited feature set and are only useful in very special and rare situations. Furthermore, there are more capable data structures that do not really have any disadvantages.
However, I might want to consider still providing these to do some stuff. For example, shape creation functions can certainly create instances of these two types.
Vec<{
vertices: [VertexProp; 3],
}>
Just stores a list of faces, where each face just stores the properties of all its vertices. This DS has no adjacency information at all. Bad, because properties are duplicated and vertices are stored implicitly. This is sometimes used to render stuff, but it's usually better to use an index buffer instead to avoid duplicating data.
So this might be worth as some serialization/storage format, but not something to perform operations on.
Vec<{
prop: VertexProp,
neighbors: Vec<VertexHandle>,
}>
A list of vertices is stored, where each vertex stores it's properties and its neighbors. Bad, because it contains lists and faces are stored implicitly.