Irlan's Physics Blog

Main menu

Post navigation

Building a Half-Edge Mesh from a Triangle List

The problem is to build a polygonal mesh from a triangle list efficiently. A solution is important specially when building or testing physics engines. The method below shows a possible solution. This can be done without needing the additional storage and processing cost of keeping a list of half-edges for a given face during its addition which would be linked at the end of the addition in that case.

The method above works because the final face edge index is used as a “tail pointer” for the face’s circular list of half-edges. It is not necessary to have the face at this index pointing to a particular edge unless required. It can point to any half-edge as long as the edge envolves the face.