Lagrange
Loading...
Searching...
No Matches
PolyDDG Module

Polygonal Discrete Differential Geometry (PolyDDG) algorithms and data structures. More...

Classes

struct  PrincipalCurvaturesOptions
 Options for compute_principal_curvatures(). More...
 
struct  PrincipalCurvaturesResult
 Result of compute_principal_curvatures(). More...
 
struct  SmoothDirectionFieldOptions
 Options for compute_smooth_direction_field(). More...
 
class  DifferentialOperators< Scalar, Index >
 Polygonal mesh discrete differential operators. More...
 
struct  HodgeDecompositionOptions
 Options for Hodge decomposition functions. More...
 
struct  HodgeDecompositionResult
 Result of Hodge decomposition functions. More...
 

Functions

template<typename Scalar, typename Index>
LA_POLYDDG_API PrincipalCurvaturesResult compute_principal_curvatures (SurfaceMesh< Scalar, Index > &mesh, const DifferentialOperators< Scalar, Index > &ops, PrincipalCurvaturesOptions options={})
 Compute per-vertex principal curvatures and principal curvature directions.
 
template<typename Scalar, typename Index>
LA_POLYDDG_API PrincipalCurvaturesResult compute_principal_curvatures (SurfaceMesh< Scalar, Index > &mesh, PrincipalCurvaturesOptions options={})
 Compute per-vertex principal curvatures and principal curvature directions.
 
template<typename Scalar, typename Index>
LA_POLYDDG_API AttributeId compute_smooth_direction_field (SurfaceMesh< Scalar, Index > &mesh, const DifferentialOperators< Scalar, Index > &ops, SmoothDirectionFieldOptions options={})
 Compute the globally smoothest n-direction field on a surface mesh.
 
template<typename Scalar, typename Index>
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_1_form (SurfaceMesh< Scalar, Index > &mesh, const DifferentialOperators< Scalar, Index > &ops, HodgeDecompositionOptions options={})
 Compute the Helmholtz-Hodge decomposition of a 1-form on a closed surface mesh.
 
template<typename Scalar, typename Index>
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_1_form (SurfaceMesh< Scalar, Index > &mesh, HodgeDecompositionOptions options={})
 Convenience overload that constructs a DifferentialOperators object internally.
 
template<typename Scalar, typename Index>
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_vector_field (SurfaceMesh< Scalar, Index > &mesh, const DifferentialOperators< Scalar, Index > &ops, HodgeDecompositionOptions options={})
 Compute the Helmholtz-Hodge decomposition of a per-vertex vector field on a surface mesh.
 
template<typename Scalar, typename Index>
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_vector_field (SurfaceMesh< Scalar, Index > &mesh, HodgeDecompositionOptions options={})
 Convenience overload that constructs a DifferentialOperators object internally.
 

Detailed Description

Polygonal Discrete Differential Geometry (PolyDDG) algorithms and data structures.

This module is based on the paper "Discrete Differential Operators on Polygonal Meshes" by de Goes et al. [1]. It provides common discrete differential operators to manipulate differential forms and vector fields on polygonal meshes.

[1] De Goes, Fernando, Andrew Butts, and Mathieu Desbrun. "Discrete differential operators on polygonal meshes." ACM Transactions on Graphics (TOG) 39.4 (2020): 110-1.

Function Documentation

◆ compute_principal_curvatures() [1/2]

template<typename Scalar, typename Index>
LA_POLYDDG_API PrincipalCurvaturesResult compute_principal_curvatures ( SurfaceMesh< Scalar, Index > & mesh,
const DifferentialOperators< Scalar, Index > & ops,
PrincipalCurvaturesOptions options = {} )

#include <lagrange/polyddg/compute_principal_curvatures.h>

Compute per-vertex principal curvatures and principal curvature directions.

Performs an eigendecomposition of the adjoint shape operator at each vertex. The two eigenvalues are the principal curvatures (kappa_min <= kappa_max) and the corresponding eigenvectors, mapped back to 3-D through the vertex tangent basis, are the principal directions. Results are stored as vertex attributes in the mesh.

Parameters
[in,out]meshInput surface mesh. Output attributes are added or overwritten.
[in]opsPrecomputed differential operators for the mesh.
[in]optionsAttribute name options. Defaults produce attributes named @kappa_min, @kappa_max, @principal_direction_min, @principal_direction_max.
Returns
Attribute IDs of the four output attributes.

◆ compute_principal_curvatures() [2/2]

template<typename Scalar, typename Index>
LA_POLYDDG_API PrincipalCurvaturesResult compute_principal_curvatures ( SurfaceMesh< Scalar, Index > & mesh,
PrincipalCurvaturesOptions options = {} )

#include <lagrange/polyddg/compute_principal_curvatures.h>

Compute per-vertex principal curvatures and principal curvature directions.

Convenience overload that constructs a DifferentialOperators object internally.

Parameters
[in,out]meshInput surface mesh. Output attributes are added or overwritten.
[in]optionsAttribute name options.
Returns
Attribute IDs of the four output attributes.

◆ compute_smooth_direction_field()

template<typename Scalar, typename Index>
LA_POLYDDG_API AttributeId compute_smooth_direction_field ( SurfaceMesh< Scalar, Index > & mesh,
const DifferentialOperators< Scalar, Index > & ops,
SmoothDirectionFieldOptions options = {} )

#include <lagrange/polyddg/compute_smooth_direction_field.h>

Compute the globally smoothest n-direction field on a surface mesh.

This function is based on the following paper:

Knöppel, Felix, et al. "Globally optimal direction fields." ACM Transactions on Graphics (ToG) 32.4 (2013): 1-10.

The solution is stored as a per-vertex 3-D tangent vector attribute in world-space coordinates, obtained by mapping the local 2-D solution through the vertex tangent basis.

Parameters
[in,out]meshInput surface mesh. The output attribute is added or overwritten.
[in]opsPrecomputed differential operators for the mesh.
[in]optionsOptions controlling the rosy order, stabilization weight, optional alignment constraints, and output attribute name.
Returns
Attribute ID of the output direction field attribute.

◆ hodge_decomposition_1_form()

template<typename Scalar, typename Index>
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_1_form ( SurfaceMesh< Scalar, Index > & mesh,
const DifferentialOperators< Scalar, Index > & ops,
HodgeDecompositionOptions options = {} )

#include <lagrange/polyddg/hodge_decomposition.h>

Compute the Helmholtz-Hodge decomposition of a 1-form on a closed surface mesh.

Takes a discrete 1-form (scalar per edge) and decomposes it into three orthogonal components:

\[ \omega = \omega_{\text{exact}} + \omega_{\text{coexact}} + \omega_{\text{harmonic}} \]

where:

  • \( \omega_{\text{exact}} = d_0 \alpha \) is the exact (curl-free) part,
  • \( \omega_{\text{coexact}} \) is the co-exact (divergence-free) part,
  • \( \omega_{\text{harmonic}} \) is the harmonic part (zero for genus-0 surfaces).

The exact part is obtained by solving the scalar Laplacian \( L_0 \alpha = \delta_1 \omega \). The co-exact part is obtained by solving a saddle-point system that minimizes the \( M_1 \)-norm subject to the constraint \( d_1 \omega_{\text{coexact}} = d_1 \omega \). The harmonic part is the residual.

Parameters
[in,out]meshInput surface mesh. Must be closed with a single connected component. The input edge attribute must already exist.
[in]opsPrecomputed differential operators for the mesh.
[in]optionsOptions. The nrosy field is ignored for 1-form decomposition.
Returns
Attribute IDs of the three output per-edge scalar attributes.

◆ hodge_decomposition_vector_field()

template<typename Scalar, typename Index>
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_vector_field ( SurfaceMesh< Scalar, Index > & mesh,
const DifferentialOperators< Scalar, Index > & ops,
HodgeDecompositionOptions options = {} )

#include <lagrange/polyddg/hodge_decomposition.h>

Compute the Helmholtz-Hodge decomposition of a per-vertex vector field on a surface mesh.

Takes a per-vertex vector field in global 3D coordinates and decomposes it into three orthogonal components, each stored as a per-vertex vector field in global coordinates:

\[ V = V_{\text{exact}} + V_{\text{coexact}} + V_{\text{harmonic}} \]

Internally, the per-vertex vector field is converted to a 1-form (scalar per edge) using midpoint integration along edges: \( \omega_e = \frac{V_i + V_j}{2} \cdot (x_j - x_i) \). Any normal component of the input vectors is automatically annihilated by the dot product with the edge vector, so explicit tangent-plane projection is not needed for n=1. The 1-form is then decomposed using hodge_decomposition_1_form(), and each component is converted back to a per-vertex vector field using the discrete sharp operator followed by area-weighted averaging from faces to vertices.

When the n-rosy option is greater than 1, each input vector is first projected into the local vertex tangent plane and its angle is multiplied by n (encoding), converting the n-rosy representative into a regular vector field. After decomposition, each output component is decoded by dividing the tangent-plane angle by n.

Parameters
[in,out]meshInput surface mesh. The input attribute (per-vertex 3D vector) must already exist. Output attributes are created or overwritten.
[in]opsPrecomputed differential operators for the mesh.
[in]optionsOptions.
Returns
Attribute IDs of the three output per-vertex vector attributes.