feat(geometry): pn_geometry.hpp — Pn projective-metric substrate (jReality port) #31

Merged
user2595 merged 2 commits from feat/pn-geometry-substrate into main 2026-05-30 15:26:26 +00:00
Owner

Summary

Ports the de.jreality.math.Pn surface that the Java algorithmic core uses across every not-yet-ported geometric phase (27 files, ≈106 imports). Porting it once unblocks all downstream consumers.

What it unblocks

Phase Consumer
9c HyperbolicLayout, FundamentalPolygon
10c′ KoebePolyhedron
10e quasi-isothermic / SphericalLayout
11c CircleDomain
hyperelliptic θ

pn_geometry.hpp (header-only, Eigen, ~120 LOC)

  • PnMetric { EUCLIDEAN=0, ELLIPTIC=+1, HYPERBOLIC=-1 } — matches jReality.
  • pn_inner_product / pn_norm / pn_dehomogenize / pn_set_to_length / pn_normalize.
  • pn_distance_between — Euclidean, elliptic (acos), hyperbolic (acosh).
  • pn_linear_interpolation — affine (E) + geodesic slerp (S/H).

HYPERBOLIC timelike-positive, anchored against projective_math.hpp::hyperbolicDistance.

Tests — 6/6 GREEN (246/246 cgal)

InnerProductSignatures · EuclideanDistance · EllipticDistanceIsAngle · HyperbolicDistanceClosedFormAndAnchor · NormAndScaling · LinearInterpolationGeodesic.

java-parity.md — Infrastructure table + Phase 9c dependency notes

Infrastructure / support layers (new section):

Layer Status
Pn ⚠️ partial → pn_geometry.hpp
Rn ⚠️ partial → Eigen inline
Matrix Eigen::Matrix4d
P2 ⚠️ port inline with Phase 9c (see below)
MatrixBuilder on demand (hyperelliptic θ only)
XML types not planned (GUI persistence)

Phase 9c rows annotated with ⚠️: FundamentalPolygonUtility and CanonicalFormUtility depend on P2.makeDirectIsometryFromFrames, P2.projectP3ToP2, P2.imbedMatrixP2InP3 + the high-precision P2Big / cpp_dec_float_50 substrate. A future Phase 9c session should start by writing p2_geometry.hpp (~5 functions, ~80 LOC) before tackling the utility classes.

🤖 Generated with Claude Code

## Summary Ports the `de.jreality.math.Pn` surface that the Java algorithmic core uses across every not-yet-ported geometric phase (27 files, ≈106 imports). Porting it once unblocks all downstream consumers. ## What it unblocks | Phase | Consumer | |---|---| | 9c | HyperbolicLayout, FundamentalPolygon | | 10c′ | KoebePolyhedron | | 10e | quasi-isothermic / SphericalLayout | | 11c | CircleDomain | | — | hyperelliptic θ | ## `pn_geometry.hpp` (header-only, Eigen, ~120 LOC) - `PnMetric { EUCLIDEAN=0, ELLIPTIC=+1, HYPERBOLIC=-1 }` — matches jReality. - `pn_inner_product` / `pn_norm` / `pn_dehomogenize` / `pn_set_to_length` / `pn_normalize`. - `pn_distance_between` — Euclidean, elliptic (acos), hyperbolic (acosh). - `pn_linear_interpolation` — affine (E) + geodesic slerp (S/H). HYPERBOLIC timelike-positive, anchored against `projective_math.hpp::hyperbolicDistance`. ## Tests — 6/6 GREEN (246/246 cgal) `InnerProductSignatures` · `EuclideanDistance` · `EllipticDistanceIsAngle` · `HyperbolicDistanceClosedFormAndAnchor` · `NormAndScaling` · `LinearInterpolationGeodesic`. ## `java-parity.md` — Infrastructure table + Phase 9c dependency notes **Infrastructure / support layers** (new section): | Layer | Status | |---|---| | `Pn` | ⚠️ partial → `pn_geometry.hpp` | | `Rn` | ⚠️ partial → Eigen inline | | `Matrix` | ✅ → `Eigen::Matrix4d` | | `P2` | ⚠️ **port inline with Phase 9c** (see below) | | `MatrixBuilder` | ❌ on demand (hyperelliptic θ only) | | XML types | ❌ not planned (GUI persistence) | **Phase 9c rows** annotated with ⚠️: `FundamentalPolygonUtility` and `CanonicalFormUtility` depend on `P2.makeDirectIsometryFromFrames`, `P2.projectP3ToP2`, `P2.imbedMatrixP2InP3` + the high-precision `P2Big` / `cpp_dec_float_50` substrate. A future Phase 9c session should start by writing `p2_geometry.hpp` (~5 functions, ~80 LOC) before tackling the utility classes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
user2595 added 1 commit 2026-05-30 15:00:58 +00:00
feat(geometry): pn_geometry.hpp — Pn projective-metric substrate (jReality port)
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m0s
API Docs / doc-build (pull_request) Successful in 1m20s
Markdown link check / check (pull_request) Successful in 47s
C++ Tests / test-cgal (pull_request) Has been skipped
C++ Tests / quality-gates (pull_request) Successful in 2m17s
f79d0b79dc
Ports the small but pervasive de.jreality.math.Pn surface that the Java
algorithmic core uses across every not-yet-ported geometric phase:
HyperbolicLayout, SphericalLayout, FundamentalPolygon (9c), KoebePolyhedron
(10c'), quasi-isothermic (10e), hyperelliptic theta, CircleDomain (11c).
Porting it once unblocks all downstream consumers instead of re-deriving
the metric ad hoc per phase.

pn_geometry.hpp — header-only, Eigen, ~120 LOC:
  PnMetric { EUCLIDEAN=0, ELLIPTIC=+1, HYPERBOLIC=-1 } matching jReality.
  pn_inner_product  — bilinear form per signature.
  pn_norm / pn_dehomogenize / pn_set_to_length / pn_normalize.
  pn_distance_between — Euclidean (spatial), elliptic (acos), hyperbolic (acosh).
  pn_linear_interpolation — affine (E) and slerp (S/H constant-speed geodesic).

HYPERBOLIC uses the timelike-positive ("upper-sheet") convention, identical to
the already-verified projective_math.hpp::hyperbolicDistance; pn_distance_between
is regression-anchored against it in the tests.

test_pn_geometry.cpp — 6 tests, all GREEN:
  InnerProductSignatures, EuclideanDistance, EllipticDistanceIsAngle,
  HyperbolicDistanceClosedFormAndAnchor (+ projective_math.hpp anchor),
  NormAndScaling, LinearInterpolationGeodesic.

doc/roadmap/java-parity.md — new "Infrastructure / support layers" section:
  de.jreality.math.Pn   → pn_geometry.hpp (partial, 6 fns covering core usage)
  de.jreality.math.Rn   → Eigen (no separate port needed)
  MatrixBuilder         → not yet (only needed for hyperelliptic theta)
  conformallab XML types → not planned (GUI persistence, not algorithmic)

246/246 cgal tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
user2595 added 1 commit 2026-05-30 15:16:01 +00:00
docs(java-parity): P2/Matrix jReality notes + Phase 9c dependency warning
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m0s
API Docs / doc-build (pull_request) Successful in 1m3s
Markdown link check / check (pull_request) Successful in 44s
C++ Tests / test-cgal (pull_request) Has been skipped
C++ Tests / quality-gates (pull_request) Successful in 2m27s
87ec7b76b0
- Infrastructure table: add Matrix (→ Eigen inline, done) and P2 rows.
  P2 marked "port inline with Phase 9c" — almost exclusively consumed by
  FundamentalPolygon/CanonicalForm/SurfaceCurve (all Phase 9c), so building
  p2_geometry.hpp as a standalone ahead of 9c would be dead weight.
- Phase 9c rows in the utility table: ⚠️ annotation listing the exact P2.*
  methods needed (makeDirectIsometryFromFrames, projectP3ToP2,
  imbedMatrixP2InP3) plus the P2Big/cpp_dec_float_50 high-precision
  prerequisite for the group-relation product ∏gᵢ = Id.

Ensures a future Phase 9c session starts with full context and does not
discover the jReality/precision dependencies mid-port.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
user2595 added 2 commits 2026-05-30 15:21:21 +00:00
docs(java-parity): P2/Matrix jReality notes + Phase 9c dependency warning
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m0s
API Docs / doc-build (pull_request) Successful in 1m3s
Markdown link check / check (pull_request) Successful in 44s
C++ Tests / test-cgal (pull_request) Has been skipped
C++ Tests / quality-gates (pull_request) Successful in 2m27s
87ec7b76b0
- Infrastructure table: add Matrix (→ Eigen inline, done) and P2 rows.
  P2 marked "port inline with Phase 9c" — almost exclusively consumed by
  FundamentalPolygon/CanonicalForm/SurfaceCurve (all Phase 9c), so building
  p2_geometry.hpp as a standalone ahead of 9c would be dead weight.
- Phase 9c rows in the utility table: ⚠️ annotation listing the exact P2.*
  methods needed (makeDirectIsometryFromFrames, projectP3ToP2,
  imbedMatrixP2InP3) plus the P2Big/cpp_dec_float_50 high-precision
  prerequisite for the group-relation product ∏gᵢ = Id.

Ensures a future Phase 9c session starts with full context and does not
discover the jReality/precision dependencies mid-port.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
docs(java-parity): P2/Matrix jReality notes + Phase 9c dependency warning
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m20s
API Docs / doc-build (pull_request) Successful in 52s
Markdown link check / check (pull_request) Successful in 1m1s
C++ Tests / test-cgal (pull_request) Has been skipped
C++ Tests / quality-gates (pull_request) Successful in 2m24s
330515ea90
- Infrastructure table: add Matrix (→ Eigen inline, done) and P2 rows.
  P2 marked "port inline with Phase 9c" — almost exclusively consumed by
  FundamentalPolygon/CanonicalForm/SurfaceCurve (all Phase 9c), so building
  p2_geometry.hpp as a standalone ahead of 9c would be dead weight.
- Phase 9c rows in the utility table: ⚠️ annotation listing the exact P2.*
  methods needed (makeDirectIsometryFromFrames, projectP3ToP2,
  imbedMatrixP2InP3) plus the P2Big/cpp_dec_float_50 high-precision
  prerequisite for the group-relation product ∏gᵢ = Id.

Ensures a future Phase 9c session starts with full context and does not
discover the jReality/precision dependencies mid-port.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
user2595 merged commit adfcb7b931 into main 2026-05-30 15:26:26 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conformallab/ConformalLabpp#31
No description provided.