dt

Curvature Estimation for Explicit Triangle Meshes in C++

A Discrete Differential Geometry Module for Feature-Line Extraction, Segmentation, and Feature-Preserving Decimation

Curvature estimation constitutes a central problem in discrete geometry processing, as it requires the approximation of differential surface properties from finite, piecewise-linear triangle mesh representations. This work presents the design and implementation of a curvature estimation module for TheMeshProject. The module is based on the explicit mesh data structure (MeshExplicit) and is implemented in modern C++. It computes mean curvature, Gaussian curvature, and principal curvature quantities as scalar fields associated with mesh vertices, thereby providing a geometric analysis layer for subsequent feature-line extraction, curvature-driven segmentation, and feature-preserving simplification.

The computed curvature fields are designed to support the following downstream processing tasks:

  • Feature Line Extraction (ridges, valleys, suggestive contours)
  • Mesh Segmentation (curvature driven region clustering)
  • Mesh Decimation (feature preserving simplification)

The implementation examined here corresponds to the optimized version integrated into the current system. The presentation focuses on the mathematical formulation of the estimators, their realization within a concrete software architecture, and the design considerations required to ensure robustness, computational efficiency, and extensibility.

1. Motivation and Role of Curvature

Curvature provides a quantitative characterization of local surface variation. In the continuous setting, curvature is defined through differential-geometric operators; in the discrete setting, analogous quantities must be approximated from the combinatorial connectivity and vertex geometry of a triangle mesh.

Within geometry-processing pipelines, curvature plays several methodological roles:

  • Feature lines appear where curvature changes sharply.
  • Segmentation relies on curvature patterns to identify meaningful regions.
  • Decimation must preserve high curvature areas to avoid losing important shape detail.

For this reason, curvature is treated as a spatial field rather than as an isolated scalar measurement. This representation enables the curvature signal to function as an intermediate descriptor for higher-level geometric analysis.

2. Continuous and Discrete Curvature Formulations

For a smooth surface, the relevant curvature quantities are defined as follows:

  • Mean curvature \(H\) measures how the surface bends on average.
  • Gaussian curvature \(K\) measures intrinsic curvature (how the surface deviates from being flat).
  • Principal curvatures \(k_1,k_2\) are the maximum and minimum bending directions.

For triangle meshes, these quantities are approximated using discrete differential operators:

  • Cotangent Laplacian → mean curvature normal
  • Angle deficit → Gaussian curvature
  • Algebraic reconstruction → principal curvatures

These operators constitute standard approximations in discrete differential geometry and offer a practical balance between mathematical consistency, computational cost, and robustness on irregular mesh data.

3. Mesh Representation and Data Requirements

The accuracy and efficiency of curvature estimation depend directly on the underlying mesh representation. The MeshExplicit structure provides the following geometric, topological, and attribute data required by the estimators:

  • positions — vertex coordinates
  • faces — triangle indices
  • vertex normals — per vertex normals
  • face normals — per face normals
  • vertex to vertex (v2v) — vertex adjacency
  • vertex to face (v2f) — incident faces
  • face to face (f2f) — neighboring faces
  • attribute storage for scalar and vector fields

This organization separates geometric access, topological traversal, and attribute storage, which supports a modular and testable curvature estimation pipeline.

4. Mean Curvature Estimation Using the Cotangent Laplacian

The cotangent Laplacian is used as a discrete approximation of the Laplace–Beltrami operator. For a vertex :

\[\Delta x_i=\sum_{j\in N(i)} w_{ij}(x_j-x_i) \]

where the cotangent weight is:

\[w_{ij}=\frac{1}{2}(\cot\alpha+\cot\beta)\]

with \(\alpha, \beta\) being the angles opposite the edge \((i,j)\).

The Laplacian of the position approximates the mean curvature normal:

\[\Delta x_i\approx2H_i\mathrm n_i\]

Projecting onto the vertex normal gives:

\[H_i=\frac{1}{2}\langle\Delta x_i,n_i\rangle\]

The resulting scalar estimate is normalized by an associated local vertex area in order to improve scale consistency and numerical stability.

The implementation follows this estimator directly by mapping each term of the formulation to local mesh-neighborhood traversal and accumulation operations.

5. Gaussian Curvature Estimation Using Angle Deficit

Gaussian curvature is treated as an intrinsic surface quantity because it depends on angular relationships within the mesh rather than on the particular embedding of the surface in Euclidean space.

For vertex i:

\[K_i=\frac{2\pi-\sum_{f\ni i}\theta_{f,i}}{A_i}\]

where:

  • \(\theta_{f,i}\) is the corner angle at vertex \(i\) in face \(f\)
  • \(A_i\) is the local vertex area (often 1/3 of incident triangle areas)

The angle-deficit formulation therefore provides a compact and robust discrete estimator for Gaussian curvature.

6. Principal Curvature Reconstruction

Given estimates of mean curvature and Gaussian curvature , the principal curvatures are reconstructed from:

\[H=\frac{k_1+k_2}{2},\quad K=k_1k_2\]

Solving:

\[k_{1,2}=H\pm\sqrt{H^2-K}\]

The recovered principal curvature values constitute compact local descriptors that are suitable for subsequent feature-line extraction and segmentation methods.

To maintain numerical robustness, the implementation clamps small negative discriminants that may occur as a consequence of floating-point error.

7. Attribute-Based Integration in MeshExplicit

Computed curvature quantities are stored as named mesh attributes:

  • "mean_curvature"
  • "gaussian_curvature"
  • "k1"
  • "k2"

This attribute-based representation enables downstream algorithms to consume curvature information for:

  • visualization
  • segmentation
  • feature detection
  • decimation metrics

while leaving the underlying mesh topology and core storage layout unchanged.

This design demonstrates the role of the attribute system as an extensible interface between geometric analysis modules and later processing stages.

8. Implementation Architecture

The software implementation is organized around modularity, computational efficiency, and numerical robustness. These objectives are reflected in several architectural decisions.

8.1 Separation of Concerns

  • MeshExplicit encapsulates geometry and adjacency information.
  • The curvature module encapsulates estimator-specific mathematics and computation.
  • The attribute system stores derived fields without modifying the core mesh representation.

8.2 Cache Friendly Layout

Adjacency traversal and face iteration are arranged to reduce cache misses and avoid unnecessary control-flow divergence during local accumulation.

8.3 Reusable Operators

Cotangent weights and vertex-area estimates are implemented as reusable discrete operators. The same primitives can support additional mesh-processing tasks, including:

  • smoothing
  • remeshing
  • parameterization
  • shape operators

8.4 Extensibility

The curvature module can be extended with:

  • principal directions
  • shape operator matrices
  • ridge/valley detectors
  • segmentation descriptors

This extensibility allows the curvature module to serve as a reusable analytical component for subsequent geometry-processing stages.

9. Curvature Field Visualization

After computation, curvature fields can be inspected through several visualization strategies:

  • Color by mean curvature magnitude
  • Color by Gaussian curvature sign
  • Highlight high curvature ridges
  • Use k1/k2 to detect feature lines

These visualizations provide qualitative validation of the estimated fields and reveal structural properties that may not be evident from the raw geometry alone.

10. Relationship to Subsequent Processing Modules

The curvature estimation module functions as a shared analytical dependency for later components of TheMeshProject. In particular, the following modules make direct use of the estimated curvature fields.

Feature Line Extraction

Feature-line extraction uses principal curvature values and, in later extensions, principal directions to identify:

  • ridges
  • valleys
  • suggestive contours
  • demarcating curves
Mesh Segmentation

Mesh segmentation uses curvature fields as geometric descriptors for clustering, boundary detection, and region identification.

Mesh Decimation

Mesh decimation incorporates curvature-derived information into simplification criteria in order to preserve salient geometric features.

Accordingly, curvature estimation acts as a foundational analytical stage on which the later geometry-processing modules depend.

11. Conclusion

This work has presented a curvature estimation module for explicit triangle meshes, designed to integrate discrete differential geometry estimators within a modular C++ geometry-processing framework. The module incorporates the following components:

  • cotangent Laplacian for mean curvature
  • angle deficit for Gaussian curvature
  • algebraic reconstruction for principal curvatures
  • MeshExplicit as the geometric foundation
  • modern C++ architecture for clarity and performance

The integration of these estimators into the core of TheMeshProject provides a reusable analytical layer for subsequent processing stages. In particular, the resulting curvature fields support feature extraction, curvature-driven segmentation, and feature-preserving simplification, while preserving a clear separation between mesh representation, numerical estimation, and downstream algorithmic use.