CGAL 4.7 - Approximation of Ridges and Umbilics on Triangulated Surface Meshes: User Manual

\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)

CGAL 4.7 - Approximation of Ridges and Umbilics on Triangulated Surface Meshes

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
User Manual

Authors
  Marc Pouget and Frédéric Cazals

Figure 65.1 Crest ridges on the David, model provided by the Digital Michelangelo Project.

This chapter describes the CGAL package for the approximating the ridges and umbilics of a smooth surface discretized by a triangle mesh. Given a smooth surface, a ridge is a curve along which one of the principal curvatures has an extremum along its curvature line. An umbilic is a point at which both principal curvatures are equal. Ridges define a singular curve, i.e., a self-intersecting curve, and umbilics are special points on this curve. Ridges are curves of extremal curvature and therefore encode important informations used in segmentation, registration, matching and surface analysis. Based on the results of the article [2], we propose algorithms to identify and extract different parts of this singular ridge curve as well as umbilics on a surface given as a triangulated surface mesh. Differential quantities associated to the mesh vertices are assumed to be given for these algorithms; such quantities may be computed by the package Estimation of Local Differential Properties of Point-Sampled Surfaces.

Note that this package needs the third party library Eigen for linear algebra operations.

# Overview

Section Ridges and Umbilics of a Smooth Surface presents the basics of the theory of ridges and umbilics on smooth surfaces. Sections Approximating Ridges on Triangulated Surface Meshes and Approximating Umbilics on Triangulated Surface Meshes present algorithms for approximating the ridges and umbilics (of a smooth surface) from a triangle mesh. Section Software Design gives the package specifications, while example calls to functions of the package are provided in Section Examples.

# Ridges and Umbilics of a Smooth Surface

For a detailed introduction to ridges and related topics, the reader may consult [3],cgal:p-gd-01, as well as the following survey article [1]. In the sequel, we just introduce the basic notions so as to explain our algorithms. Consider a smooth embedded surface, and denote \( k_1\) and \( k_2\) the principal curvatures, with \( k_1\geq k_2\). Umbilics are the points where \( k_1=k_2\). For any non umbilical point, the corresponding principal directions of curvature are well defined, and we denote them \( d_1\) and \( d_2\). In local coordinates, we denote \( \langle , \rangle\) the inner product induced by the ambient Euclidean space, and \( dk_1\), \( dk_2\) the gradients of the principal curvatures. Ridges, illustrated in Figure 65.2 for the standard ellipsoid, are defined by:

Definition. A non umbilical point is called

- a max ridge point, if the extremality coefficient \( b_0=\langle dk_1,d_1 \rangle\) vanishes, i.e. \( b_0=0\).

- a min ridge point, if the extremality coefficient \( b_3=\langle dk_2,d_2 \rangle\) vanishes, i.e. \( b_3=0\) Notations \( b_0, b_3\) comes from Equation eqmonge .

The previous characterization of ridges involves third-order differential properties. Using fourth-order differential quantities, a ridge point can further be qualified as elliptic if it corresponds to a maximum of \( k_1\) or a minimum of \( k_2\), or hyperbolic otherwise. Hence we end up with four types of ridges, namely: MAX_ELLIPTIC_RIDGE, MAX_HYPERBOLIC_RIDGE, MIN_ELLIPTIC_RIDGE, MIN_HYPERBOLIC_RIDGE, which are illustrated in Figure 65.2. Also of interest are the crest lines, a crest line being an elliptic ridge which is a maximum of \( \max(|k_1|,|k_2|)\). Crest lines form a subset of elliptic ridges, and can be seen as the visually most salient curves on a surface. Hence we provide the two additional ridge types MAX_CREST_RIDGE and MIN_CREST_RIDGE, which are illustrated in Figure 65.1.

Figure 65.2 Ridges on the ellipsoid, normals pointing outward. Color coding: MAX_ELLIPTIC_RIDGE are blue, MAX_HYPERBOLIC_RIDGE are green, MIN_ELLIPTIC_RIDGE are red and MIN_HYPERBOLIC_RIDGE are yellow. The red line is also the MIN_CREST_RIDGE and this is the only crest ridge of the ellipsoid.

At any point of the surface which is not an umbilic, principal directions \( d_1, d_2\) are well defined, and these (non oriented) directions together with the normal vector \( n\) define two direct orthonormal frames. If \( v_1\) is a unit vector of direction \( d_1\) then there exists a unique unit vector \( v_2\) so that \( (v_1,v_2,n)\) is direct, that is has the same orientation as the canonical basis of the ambient \( 3d\) space (and the other possible frame is \( (-v_1,-v_2,n)\)). In the coordinate systems \( (v_1,v_2,n)\), the surface has the following canonical form, known as the Monge form :

\begin{eqnarray} z(x,y) = & \frac{1}{2}(k_1x^2 + k_2y^2)+ \frac{1}{6}(b_0x^3+3b_1x^2y+3b_2xy^2+b_3y^3) \\ & +\frac{1}{24}(c_0x^4+4c_1x^3y+6c_2x^2y^2+4c_3xy^3+c_4y^4) + h.o.t \end{eqnarray}

The Taylor expansion of \( k_1\) (resp. \( k_2\)) along the max (resp. min) curvature line going through the origin and parameterized by \( x\) (resp. \( y\)) are:

\[ \begin{equation} k_1(x) = k_1 + b_0x + \frac{P_1}{2(k_1-k_2)}x^2 + ... , \quad \quad \quad P_1= 3b_1^2+(k_1-k_2)(c_0-3k_1^3). \end{equation} \]

\[ \begin{equation} k_2(y) = k_2 + b_3y + \frac{P_2}{2(k_2-k_1)}y^2 + ... , \quad \quad \quad P_2= 3b_2^2+(k_2-k_1)(c_4-3k_2^3). \end{equation} \]

Notice also that switching from one to the other of the two afore-mentioned coordinate systems reverts the sign of all the odd coefficients on the Monge form of the surface.

Hence ridge types are characterized by

- max ridge if \( b_0=0\)
- MAX_ELLIPTIC_RIDGE if \( b_0=0\) and \( P_1<0\)
- MAX_HYPERBOLIC_RIDGE if \( b_0=0\) and \( P_1>0\)
- min ridge if \( b_3=0\)
- MIN_ELLIPTIC_RIDGE if \( b_3=0\) and \( P_2<0\)
- MIN_HYPERBOLIC_RIDGE if \( b_3=0\) and \( P_2>0\)
- MAX_CREST_RIDGE if \( b_0=0\) and \( P_1<0\) and \( |k_1|>|k_2|\)
- MIN_CREST_RIDGE if \( b_3=0\) and \( P_2<0\) and \( |k_2|>|k_1|\)

As illustrated in Figure 65.3 and Figure 65.4, the patterns made by curvature lines around an umbilic can be characterized using the notion of an index associated to the principal directions - see also [1]. As depicted in Figure 65.3, consider a small circuit \( C\) around the umbilic, and a point \( p \in C\). Starting from an initial orientation \( u\) of a tangent vector to the curvature line through point \( p\), propagate by continuity this orientation around the circuit. The index is defined by the angle swept by \( u\) around this revolution, normalized by \( 2\pi\). In our example, the index is thus 1/2.

If the index of the principal direction field is \( 1/2\) then it is called a ELLIPTIC_UMBILIC, if it is \( -1/2\) it is called a HYPERBOLIC_UMBILIC. Otherwise the umbilic is qualified NON_GENERIC_UMBILIC.

Figure 65.3 Index \(1/2\) umbilic or elliptic umbilic.

Figure 65.4 Elliptic and hyperbolic umbilics.

# Approximating Ridges on Triangulated Surface Meshes

Our method aims at reporting ridges as polygonal lines living on the mesh. It assumes differential quantities are available for each vertex of the mesh (principal curvatures and directions together with third order quantities \( b_0, b_3\) and optionally fourth order quantities \( P_1, P_2\)). These differential quantities may be computed for the smooth surface the mesh is inscribed in (analytically or using approximation methods), or may be estimated for a mesh given without reference to an underlying smooth surface. Although the ridge approximation algorithm is the same in both cases, one cannot ambition to ask for the same certificates. This distinction calls for the notion of compliant mesh.

Compliant meshes.

Ridges of a smooth surface are points with prescribed differential properties, and reporting them from a mesh inscribed in the surface requires delicate hypothesis on the geometry of that mesh so as to get a certified result. In this paragraph, we assume the mesh provided complies with a number of hypothesis, which guarantee the topology of the ridges reported matches that of the ridges on the smooth surface. To summarize things, a compliant mesh is a mesh dense enough so that (i) umbilics are properly isolated (ii) ridges running next to one another are also properly separated. See [2] for a detailed discussion of compliant meshes.

As 0-level set of the extremality coefficients \( b_0\) and \( b_3\), ridges are extracted by a marching triangles algorithm.A marching triangles algorithm is similar to a 2d marching cubes algorithm (or marching rectangles algorithm), except that a one-manifold is reported on a two-manifold tessellated by triangles.

As the signs of these extremality coefficients depend on the orientation of the principal directions, we expect both extremalities and vectors orienting the principal direction to be given at each point vertex of the mesh. Except in the neighborhood of umbilics, if the mesh is dense enough, a coherent orientation of principal directions at both endpoints of an edge is chosen such that the angle between the two vectors is acute. This rule, the acute rule, is precisely analyzed in [2]. Moreover, we only seek ridges in triangles for which one can find an orientation of its three vertices such that the three edges are coherently oriented by the acute rule. Such triangles are called regular. This said, two remarks are in order.

- Regular triangles and ridge segments. A regular triangle has 0 or 2 edges crossed by a max (resp. min) ridge, which is tantamount to a sign change of \( b_0\) (resp. \( b_3\)) along the corresponding edges. In the latter case, we say that the triangle contains a ridge segment. Two methods are provided to compute its type, be it elliptic or hyperbolic. First, if fourth order differential quantities are provided, one can use the \( P_1\) ( \( P_2\)) values of Equations eqtaylor_along_line ( eqtaylor_along_red_line) for a max (min) ridge. The value of \( P_i\) for a ridge segment is defined as the mean value of the \( P_i\) values of the two crossing points on edges (while the value at a crossing point on an edge is the \( b_i\)-weighted mean value of the values at endpoints). Alternatively, if third order differential quantities only are available, one may use the geometric method developed in [2].

Using the notion of ridge segment, a `Ridge_line` is defined as a maximal connected sequence of ridge segments of the same type and connected together. Notice that the topology of a `Ridge_line` is either that of an interval or a circle.

- Non-regular triangles. In the neighborhood of umbilics, triangle are less likely to be regular and the detection of ridges cannot be relevant by this method. This is why we propose another method to detect umbilics independently.

Non compliant meshes: filtering ridges on strength and sharpness.

For real world applications dealing with coarse meshes, or meshes featuring degenerate regions or sharp features, or meshes conveying some amount of noise, the compliance hypothesis [2] cannot be met. In that case, it still makes sense to seek loci of points featuring extremality of estimated principal curvatures, but the ridges reported may require filtering. For example, if the principal curvatures are constant

- which is the case on a plane or a cylinder, then all points are ridge points. In this context, an appealing notion is that of sharp ridge or prominent ridge. Since ridges are witnessed by zero crossings of \( b_0\) and \( b_3\), one can expect erroneous detections as long as these coefficients remain small. In order to select the most prominent ridge points, we focus on points where the variation of the curvature is fast along the curvature line. One can observe that, at a ridge point, according to Equation eqtaylor_along_line, the second derivative of \( k_1\) along its curvature line satisfies \( k_1^{''}(0) = P_1/(k_1-k_2)\). Using this observation, one can define the sharpness of a ridge as the integral of the absolute value of \( P_1/(k_1-k_2)\) along the ridge. As the second derivative of the curvature is homogeneous to the inverse of the cube of a length, the sharpness is homogeneous to the inverse of the square of a length. Multiplying the sharpness by the square of the model size gives a threshold and an associated sharpness-filter which are scale independent. Another filtering is also available with the strength which is the integral of the curvature along the ridge line [4].

# Approximating Umbilics on Triangulated Surface Meshes

The method aims at identifying some vertices of a mesh as umbilics. It assumes principal curvatures and directions are given at each vertex on the mesh.

Algorithm.

Assume each vertex \( v\) of the mesh comes with a patch (a topological disk) around it. Checking whether vertex \( v\) is an umbilic is a two stages process, which are respectively concerned with the variation of the function \( k_1-k_2\) over the patch, and the index of the vertex computed from the boundary of the patch. More precisely, vertex \( v\) is declared to be an umbilic if the following two conditions are met:

- the function \( k_1-k_2\) has its minimum at \( v\) amongst all the vertices of the patch;
- the deviation \( \delta\) of any principal direction along the patch boundary, traversed counter-clock-wise (CCW), has prescribed properties:
  - \( \delta \in ]\pi/2,3\pi/2[\), then the umbilic is called elliptic,
  - \( \delta \in ]-3\pi/2,-\pi/2[\), then the umbilic is called a hyperbolic,
  - otherwise the umbilic is called non-generic.

Finding patches around vertices.

Given a vertex \( v\) and a parameter \( t\), we aim at defining a collection of triangles around \( v\) so that (i) this collection defines a topological disk on the triangulation \( T\) and (ii) its size depends on \( t\). First we collect the 1-ring triangles. We define the size \( s\) of this 1-ring patch as the (Euclidean) distance from \( v\) to its farthest 1-ring vertex neighbor. We then collect recursively adjacent triangles so that the patch remains a topological disk and such that these triangles are at distance less than \( s\times t\). Parameter \( t\) is the only parameter of the algorithm.

Umbilical patches versus ridges. On a generic surface, generic umbilics are traversed by one or three ridges. For compliant meshes, an umbilic can thus be connected to the ridge points located on the boundary of its patch. This functionality is not provided, and the interested reader is referred to [2] for more details.

# Software Design

All classes of this package are templated by the parameter `TriangleMesh`, which defines the type of the mesh to which the approximation algorithms operate.

The differential quantities are provided at vertices of this mesh via property maps, a concept commonly used in the Boost library. Property maps enables the user to store scalars and vectors associated to a vertex either internally in extended vertices or externally with a `std::map` combined with a `boost::associative_property_map`.

Output of ridges or umbilics are provided via output iterators.

Approximation of ridges and umbilics are performed by two independent classes, which we now further describe.

## Ridge Approximation

The main class is `Ridge_approximation<TriangleMesh,VertexFTMap,VertexVectorMap>`. Its construction requires the mesh and the property maps defining the differential quantities for principal curvatures \( k_1\) and \( k_2\), the third order extremalities \( b_0\) and \( b_3\), the principal directions of curvature \( d_1\) and \( d_2\), and the fourth order quantities \( P_1\) and \( P_2\) if the tagging of ridges as elliptic or hyperbolic is to be done using the polynomials \( P_1\) and \( P_2\).

Three functions (provided as members and also as global functions) enable the computation of different types of ridges :

- `compute_max_ridges()` (resp. `compute_min_ridges()`) outputs ridges of types MAX_ELLIPTIC_RIDGE and MAX_HYPERBOLIC_RIDGE (resp. `MIN_ELLIPTIC_RIDGE` and MIN_HYPERBOLIC_RIDGE).
- `compute_crest_ridges()` outputs ridges of types MAX_CREST_RIDGE and MIN_CREST_RIDGE.

These functions allows the user to specify how the elliptic/hyperbolic tagging is carried out. Notice the rationale for the choice of these three functions is simple: each computation needs a single pass over the triangles of the mesh. This should be clear for the min and max ridges. For crests, just notice max and min crests cannot intersect over a triangle.

The ridge lines are stored in `Ridge_line` objects and output through an iterator. Each ridge line is represented as a list of halfedges of the mesh it crosses with a scalar defining the barycentric coordinate of the crossing point with respect to the half-egde endpoints. Each ridge line comes with its type `Ridge_type`, its strength and sharpness.

If one chooses to use only third order quantities, the quantities \( P_i\) do not have to be defined. Then the sharpness will not be defined.

## Umbilic Approximation

The main class is `Umbilic_approximation<TriangleMesh,VertexFTMap,VertexVectorMap>`. Its construction requires the mesh and the property maps defining the differential quantities for principal curvatures \( k_1\) and \( k_2\), and the principal directions of curvature \( d_1\) and \( d_2\). The member function `compute()` (or the global function `compute_umbilics()`) has a parameter to define the size of the neighborhood of the umbilic.

Umbilics are stored in `Umbilic` objects, they come with their type : ELLIPTIC_UMBILIC, HYPERBOLIC_UMBILIC or NON_GENERIC_UMBILIC; the vertex of the mesh they are associated to and the list of half-edges representing the contour of the neighborhood.

# Examples

## Example Program

The following program computes ridges and umbilics from an off file.Model data may be downloaded via ftp://ftp.mpi-sb.mpg.de/pub/outgoing/CGAL/Ridges_3_datafiles.tgz . The mechanical part model has been provided courtesy of Dassault System to produce Figure 65.6, due to copyright issues the available model is not the same, it is provided by the AIM@SHAPE Shape Repository. It uses the package Estimation of Local Differential Properties of Point-Sampled Surfaces to estimate the differential quantities. The default output file gives rough data for visualization purpose, a verbose output file may also be asked for. Parameters are

- \( d\), the degree of the jet for the `Monge_via_jet_fitting` class, \( d\) must be greater or equal to 3 which is the default value;
- \( m\), the degree of the Monge representation for the `Monge_via_jet_fitting` class, \( m\) must be 3 (the default value) or 4 and smaller than \( d\);
- \( a\), the number of rings of neighbors collected for the `Monge_via_jet_fitting` class, in addition the number of vertices collected must be greater than \( Nd:=(d+1)(d+2)/2\) to make the approximation possible. \( a\) may be an integer greater than 1, the value 0 (which is the default) means that the minimum number of rings is collected to make the approximation possible. (Alternatively option \( p\) allows the specification of a constant number of neighbors);
- \( t\), the `Ridge_order` for the distinction between elliptic and hyperbolic ridges, \( t\) is 3 (default) or 4;
- \( u\), the parameter for umbilic patch size, \( u \geq 1\) (default is 1).

//this is an enriched Polyhedron with facets' normal
#include "PolyhedralSurf.h"
#include <CGAL/Ridges.h>
#include <CGAL/Umbilics.h>
typedef PolyhedralSurf::Traits Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point_3;
typedef Kernel::Vector_3 Vector_3;
typedef boost::graph_traits<PolyhedralSurf>::vertex_descriptor vertex_descriptor;
typedef boost::graph_traits<PolyhedralSurf>::vertex_iterator vertex_iterator;
typedef boost::graph_traits<PolyhedralSurf>::face_descriptor face_descriptor;
typedef std::map<vertex_descriptor, FT> VertexFT_map;
typedef boost::associative_property_map< VertexFT_map > VertexFT_property_map;
typedef std::map<vertex_descriptor, Vector_3> VertexVector_map;
typedef boost::associative_property_map< VertexVector_map > VertexVector_property_map;
//RIDGES
typedef CGAL::Ridge_line<PolyhedralSurf> Ridge_line;
typedef CGAL::Ridge_approximation <PolyhedralSurf,
VertexFT_property_map,
VertexVector_property_map > Ridge_approximation;
//UMBILICS
typedef CGAL::Umbilic<PolyhedralSurf> Umbilic;
typedef CGAL::Umbilic_approximation < PolyhedralSurf,
VertexFT_property_map,
VertexVector_property_map > Umbilic_approximation;
//create property maps
VertexFT_map vertex_k1_map, vertex_k2_map,
vertex_b0_map, vertex_b3_map,
vertex_P1_map, vertex_P2_map;
VertexVector_map vertex_d1_map, vertex_d2_map;
VertexFT_property_map vertex_k1_pm(vertex_k1_map), vertex_k2_pm(vertex_k2_map),
vertex_b0_pm(vertex_b0_map), vertex_b3_pm(vertex_b3_map),
vertex_P1_pm(vertex_P1_map), vertex_P2_pm(vertex_P2_map);
VertexVector_property_map vertex_d1_pm(vertex_d1_map), vertex_d2_pm(vertex_d2_map);
int main(int argc, char *argv[])
{
//compute differential quantities with the jet fitting package
...
//initialize the property maps
...
//Ridges
//--------------------------------------------------------------------------
Ridge_approximation ridge_approximation(P,
vertex_k1_pm, vertex_k2_pm,
vertex_b0_pm, vertex_b3_pm,
vertex_P1_pm, vertex_P2_pm,
vertex_d1_pm, vertex_d2_pm);
std::vector<Ridge_line*> ridge_lines;
std::back_insert_iterator<std::vector<Ridge_line*> > ii(ridge_lines);
//Find MAX_RIDGE, MIN_RIDGE, CREST or all ridges
ridge_approximation.compute_max_ridges(ii, tag_order);
ridge_approximation.compute_min_ridges(ii, tag_order);
ridge_approximation.compute_crest_ridges(ii, tag_order);
// UMBILICS
//--------------------------------------------------------------------------
Umbilic_approximation umbilic_approximation(P,
vertex_k1_pm, vertex_k2_pm,
vertex_d1_pm, vertex_d2_pm);
std::vector<Umbilic*> umbilics;
std::back_insert_iterator<std::vector<Umbilic*> > umb_it(umbilics);
umbilic_approximation.compute(umb_it, umb_size);
}

## Example: Ridges and Umbilics on an Ellipsoid

For Figure 65.5, the data have been computed as follows:

./Compute_Ridges_Umbilics -f data/ellipsoid_u_0.02.off -d 4 -m 4 -a 3 -t 3

In addition, the four elliptic umbilics are detected, the standard output being

nb of umbilics 4
Umbilic at location (-0.80899 0.00426003 0.293896) of type elliptic
Umbilic at location (-0.811197 0.0122098 -0.292259) of type elliptic
Umbilic at location (0.808372 -0.00551307 -0.29431) of type elliptic
Umbilic at location (0.81413 0.0018689 0.290339) of type elliptic

Figure 65.5 Ridges on the ellipsoid, normals pointing outward. Color coding : MAX_ELLIPTIC_RIDGE are blue, MAX_HYPERBOLIC_RIDGE are green, MIN_ELLIPTIC_RIDGE are red and MIN_HYPERBOLIC_RIDGE are yellow.

## Example: Filtering of Crest Ridges on a Mechanical Part

Figure 65.6 illustrates the filtering of crest ridges on a mechanical model, and has been computed as follows:

./Compute_Ridges_Umbilics -f data/mecanic.off -d 4 -m 4 -a 4 -t 4

Figure 65.6 Mechanical part (37k pts). Left: All crest lines. Middle: crests filtered with the strength threshold 1. Right: crests filtered with the sharpness threshold 100 000. Notice that any point on a flat or cylindrical part lies on two ridges, so that the noise observed on the first two figures is unavoidable. It is however easily filtered out with the sharpness as can be seen on the right figure.