The fmesher C++ library

Finn Lindgren

The plan is to briefly describe the backend fmesher C++ library.

Introduction

The fmesher C++ library was initially written by Finn Lindgren in April/May 2010, as an implementation of the data structures and refined constrained Delaunay triangulation (RCDT) methods from Hjelle and Dæhlen (2006), extended to RCDTs on spheres.

Data structures

The key to the algorithm speed is the use of traversal operators for the mesh graph, made efficient by support in the data structure for key operations.

Triangle centric data model

The mesh storage is composed of a 3-column matrix of vertex coordinates, S, and three triangle graph topology 3-column integer matrices:

This is similar to a winged-edge or half-edge structure, but treats triangles as primary objects, allowing compact storage as well as efficient graph traversal.

Note: A further structure, VT, can be enabled, that for each vertex holds the set of triangle indices that it is used by. Before 2025, only a single triangle index was stored, so that there was no cheap way to access all triangles that connect to a given vertex, unless the mesh was a proper edge-connected manifold. For example, some operation would not handle meshes where the forward and inverse orbit0 operations could not reach all the connected triangles.

Graph traversal algebra

These operators, and their inverses, allow arbitrary graph traversal of 2-manifold meshes with triangles connected via edges.

Matrices

Point locator trees

Operations

RCDT

Point locator

Rcpp interface

rcdt

bary

fem

split_lines

References

Hjelle, Øyvind, and Morten Dæhlen. 2006. Triangulations and Applications. Springer Berlin, Heidelberg. https://doi.org/10.1007/3-540-33261-8.