feat(phase3f+3g): analytical Hessians + PI consolidation

Phase 3g — constants.hpp:
  - Introduce conformallab::PI and TWO_PI in a single constants.hpp
  - Remove scattered local PI/pi definitions from hyper_ideal_geometry.hpp,
    hyper_ideal_utility.hpp, euclidean_functional.hpp, mesh_builder.hpp,
    spherical_geometry.hpp (backward-compatible PI_SPHER alias kept)

Phase 3f — Euclidean Hessian (euclidean_hessian.hpp):
  - Cotangent-Laplace operator (Pinkall–Polthier 1993)
  - euclidean_cot_weights() helper + euclidean_hessian() + hessian_check_euclidean()
  - Correct Pinkall–Polthier 1/2 normalization factor
  - 8 tests: cot weights, symmetry, null-space (H·1=0), PSD, FD × 4 meshes

Phase 3f — Spherical Hessian (spherical_hessian.hpp):
  - Derives ∂α_i/∂u_j directly from the spherical law of cosines:
      ∂α1/∂l_opp  = sin(l_opp) / [sin(l_a)·sin(l_b)·sin(α1)]
      ∂α1/∂l_adj  = [cot(l_adj)·cos(α1) − cot(l_other)] / sin(α1)
    then chains with ∂l/∂λ = tan(l/2)
  - spherical_cot_weights() kept as a standalone helper (tested separately)
  - 8 tests: cot weights, symmetry, correct null-space & sign-convention
    (H·1 ≠ 0; H is NSD at equilibrium), FD × 3 meshes

All 62 cgal tests pass (3 skipped as before).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-05-12 17:22:28 +02:00
parent 8c353bb884
commit 194effba97
11 changed files with 929 additions and 22 deletions

View File

@@ -9,6 +9,7 @@
// These builders cover the minimal meshes needed for functional unit tests.
#include "conformal_mesh.hpp"
#include "constants.hpp"
#include <cmath>
#include <vector>
@@ -93,7 +94,7 @@ inline ConformalMesh make_fan(int n)
auto center = mesh.add_vertex(Point3(0, 0, 0));
const double dtheta = 2.0 * M_PI / n;
const double dtheta = TWO_PI / n;
std::vector<Vertex_index> rim(n);
for (int i = 0; i < n; ++i) {
double a = i * dtheta;