Skip to content

Mesh Implementations Data Structures

Lukas Kalbertodt edited this page Jun 18, 2018 · 10 revisions

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.

Weak data structures

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.

FaceList

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.

Vertex-Vertex

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.

Medium strong data structures


Links

Clone this wiki locally