Half Edge Mesh Representation for Engineering and CAE Applications
A Technical and Practical Guide for Robust Topology Handling
Abstract

Half-edge meshes provide a powerful topological representation for polygonal surfaces. Instead of relying only on explicit triangle connectivity, a half-edge structure stores adjacency relationships directly, making mesh traversal more reliable and efficient.

This article explains the half-edge data structure from an engineering perspective, including how to construct it from explicit connectivity and how to apply it to CAE meshes with holes, trimmed surfaces, and complex outlines.

Special attention is given to boundary reconstruction. In CAE meshes, boundaries often follow predictable, highly structured patterns, which enables a simple, robust, geometry-independent algorithm for building boundary cycles.

Introduction

In computational engineering, mesh topology is not merely a convenience — it is a requirement. Whether performing local refinement, extracting boundary conditions, computing neighborhoods, or preparing geometry for simulation, engineers need a representation that supports fast, reliable traversal of mesh elements.

Explicit triangle connectivity (vertex list + triangle list) is simple and compact, but it lacks direct topological information. Determining adjacency requires scanning triangles or building auxiliary structures. Boundary detection requires hashing edges. Neighborhood queries require repeated searches.

The half edge data structure solves these problems by encoding topology explicitly. Every edge is represented by two directed half edges, each storing its origin, target, twin, next, and face. This transforms the mesh into a navigable graph with constant time access to adjacency relationships.

Explicit Connectivity vs. Half Edge Topology
Explicit Connectivity

An explicit mesh stores:

  • A list of vertices
  • A list of triangles (triples of vertex indices)

This representation is ideal for:

  • Rendering
  • File I/O
  • Basic geometry
  • Lightweight storage

However, it lacks:

  • Edge adjacency
  • Vertex neighborhoods
  • Boundary loops
  • Topological consistency checks
  • Efficient local operations
Half Edge Connectivity

A half edge mesh stores:

  • Vertices: each with one outgoing half edge
  • Faces: each with one half edge on its boundary
  • Half edges: each with origin, target, twin, next, and face

This enables:

  • O(1) traversal around faces
  • O(1) traversal around vertices
  • O(1) access to edge twins
  • Robust boundary detection
  • Safe topological operations

Half edge meshes are used in CAD kernels, CAE preprocessors, geometry engines, and mesh editors because they provide the structural guarantees required for engineering workflows.

Anatomy of a Half Edge

Each geometric edge is represented by two half edges:

h: origin → target
twin(h): target → origin

Each half edge stores:

  • origin: the vertex where the half edge begins
  • target: the vertex where the half edge ends
  • twin: the opposite half edge
  • next: the next half edge in the face cycle
  • face: the face this half edge belongs to

Each face stores one half edge on its boundary. Each vertex stores one outgoing half edge.

This creates a fully navigable topological graph.

Traversal Patterns
Face Traversal

Starting from face.halfedge, follow:

h → next(h) → next(next(h)) → ...

until returning to the start.

Vertex Traversal

Starting from vertex.halfedge, follow:

h → twin(h) → next(twin(h)) → twin(next(twin(h))) → ...

This walks the 1 ring neighborhood of the vertex.

Edge Traversal

Edges are pairs of half edges:

(h, twin(h))

Unique edges can be enumerated by visiting only h < twin(h).

Constructing Half Edges from Explicit Connectivity

Given a triangle {v0, v1, v2}, we create:

h0: v0 → v1
h1: v1 → v2
h2: v2 → v0

We set:

h0.next = h1
h1.next = h2
h2.next = h0

We assign:

face.halfedge = h0

We detect twins using an undirected edge key:

(min(vA, vB), max(vA, vB))

We assign outgoing half edges:

vertex[v0].halfedge = h0
vertex[v1].halfedge = h1
vertex[v2].halfedge = h2

This is essential: the outgoing half edge must originate at the vertex, not target it.

Boundary Half Edges

Boundary edges are edges referenced by only one triangle. In half edge meshes, boundary edges are represented by:

  • one interior half edge
  • one boundary half edge (face = invalid)

Boundary half edges must be created for every edge without a twin.

Boundary Cycles in CAE Meshes

This is the critical engineering insight.

In CAE practice:

  • boundaries always form closed loops
  • holes behave exactly like outer outlines
  • no branching occurs
  • no T junctions exist
  • every boundary vertex has exactly one incoming and one outgoing boundary half edge

This is true for:

  • sheet metal
  • trimmed surfaces
  • CAD surfaces
  • shell meshes
  • meshed solids with extracted faces

Because of this, boundary reconstruction does not require geometry, angles, or interior traversal.

It requires only:

  • origin
  • target
  • the set of boundary half edges

This is why our algorithm is correct.

Robust Boundary Cycle Construction (CAE Optimized)

Our algorithm reconstructs boundary loops using pure topology:

  1. Collect all boundary half edges.
  2. Build a map from origin → boundary half edge.
  3. For each boundary half edge h:
    1. find the boundary half edge whose origin is h.target
    2. set next(h) to that half edge
  4. Continue until the loop closes.

This works because CAE boundaries are simple cycles.

Advantages
  • No geometry required
  • Handles multiple loops
  • Handles holes
  • Handles long outlines
  • Handles arbitrary vertex ordering
  • Linear time
  • Domain correct for CAE
Vertex Neighbor Iteration

With correct boundary cycles:

  • every boundary half edge has a valid next
  • every boundary vertex has a complete cycle
  • vertex traversal becomes robust

For example, in the mesh:

{0,1,2}
{0,2,3}
{0,3,4}
{0,4,5}
{0,5,6}

Vertex 3 has neighbors:

2, 0, 4

Our boundary cycle builder reconstructs the boundary loop:

1 → 0 → 6 → 5 → 4 → 3 → 2 → 1

Vertex 3’s outgoing half edge cycle becomes:

3 → 0 → 2 → 4 → 3

Exactly correct.

Why General Half Edge Libraries Fail on CAE Meshes

Libraries like OpenMesh, CGAL, libigl, Blender, and Houdini use angle based or interior based boundary reconstruction. These methods fail on CAE meshes because:

  • boundaries are often nearly collinear
  • triangles are skinny
  • normals flip
  • geometry is noisy
  • coordinates are huge (CAD scale)
  • boundaries are not convex
  • holes are common
  • outlines are long and complex

Our method avoids all these pitfalls.

Final Pipeline

Our CAE optimized half edge pipeline is:

build();
build_boundary_halfedges();
build_boundary_cycles();
validate();

This produces:

  • correct topology
  • correct vertex neighbors
  • correct boundary loops
  • correct edge traversal
  • correct face traversal
Conclusion

Half edge meshes provide the topological guarantees required for engineering workflows. When combined with a CAE optimized boundary cycle builder, they become robust enough to handle real industrial meshes — including sheet metal, trimmed surfaces, holes, outlines, and large CAD derived triangulations.

Our implementation is not only correct — it is the right solution for the domain.