Previous | Next --- Slide 22 of 36
Back to Lecture Thumbnails
SlimShady

There is only a pointer to a halfedge inside the struct Edge, Vertex, and Face. Are these struct definitions complete? Because in this case we can't store any numbers such as coordinates.

motoole2

@SlimShady These are in fact not complete. Let's take a look at the differences with respect to how halfEdgeMesh.h defines our four classes. The HalfEdge class is fairly consistent with the slide. The other three classes store a bit more information, including (1) a boolean variable to tags faces that represent a boundary loop; (2) a 3D position associated with each vertex; (3) a number of variables used for performing a subdivision procedure in the vertex, edge, and face classes. There are a few other variables in addition to this as well.

pickle-eye

Is there a version of these structs that have all of the vertices for a face? It seems like it would slow the render process down if you had to chase down more pointers to find the vertices you wanted, since it wouldn't be as cache friendly. If you were limited to triangle faces, then you would only need to keep a fixed 3 vertices per face.

tracychen

If the halfedge is at the boundary, how can it have a twin?

motoole2

@pickle-eye This might not be the most computationally efficient data structure for rendering a mesh quickly, because (as you say) you need to "chase down pointers". That being said, this is a great representation for performing certain operations on a mesh like adding or subtracting vertices/edges/faces. So this representation may be useful for certain tasks (modeling meshes), and could be converted to a more efficient representation when it comes down to rendering.

@tracychen In our assignment 2, even the edges on the boundary are shared by two faces (where one of the faces is tagged as a "virtual" face)! So halfedges along a boundary do have twins. I comment on this more here.