You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 8: Mesh Representations and Geometry Processing (21)
curiousdragon

So I think understand from lecture that we want Tri to correspond to the center blue triangle, and have pointers toward its 3 vertices (v) and toward its 3 surrounding triangles (t).

In that case, how come the Vert struct only supports a pointer to a single Tri, instead of to an array of 3 Tri's? For example, in the diagram on the right for the v[2] vertex, it is a vertex for the blue triangle, for t[2], and for t[0].

Or do we assign say v[0] to the blue triangle (so the t pointer for the v[0] vertex points to the blue triangle Tri struct) and similarly assign each vertex only one of its adjacent triangles?

stexus

A vertex can potentially have many more than 3 triangles. I think in this structure, each vertex is uniquely assigned to a triangle so you may be able to have more than one vertex per point?

Gabe-Mitnick

Prof O'Brien actually talks about this in the lecture recording that just came out. @stexus There's only Vert struct per point, and multiple different Tri structs can have pointers to the same Vert if they share that vertex. @curiousdragon Like stexus said, a vertex can be shared by any number of triangles. In lecture, Prof O'Brien said that if each Vert stored pointers to every Tri that uses that vertex, we'd have to use a variable-length data structure like a linked list to list all the Tri*'s for each Vert, which would be a pain to manage, and it would take more memory. Instead, in this data structure, each Tri has fixed-length arrays to point to its 3 Vert's and 3 neighbor Tri's; but each Vert stores a pointer to just one of its adjacent Tri's (doesn't matter each one). Then we can iterate over all of the adjacent Tri's by stepping from one to the next using each Tri's array of adjacent Tri's. The code for this is on the next slide.

ShaamerKumar

I just wanted to add to this conversation by summarising the kind of benefits and drawbacks of this datastructure as discussed by @Gabe-Mitnick and the others.

For the benefits: it allows for a more efficient use of memory, as each vertex only stores a pointer to one of its adjacent triangles, rather than a list of all its adjacent triangles. This would, in turn, reduce memory usage compared to using a variable-length data structure such as a linked list, as mentioned above.

For the negatives: traversing the entire mesh and accessing all the vertices and triangles would need us to traverse through a bunch of pointers.

You must be enrolled in the course to comment