Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/cpp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ jobs:

- name: Run Tests
run: |
cd src/cpp/build
ctest --output-on-failure
ctest --test-dir src/cpp/build --build-config ${{ matrix.build_type }} --output-on-failure
24 changes: 24 additions & 0 deletions .github/workflows/python-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Python Checks

on:
push:
branches: [main, develop]
paths:
- 'examples/python/**'
- '.github/workflows/python-checks.yml'
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Run dependency-free inspector tests
working-directory: examples/python
run: python -m unittest -v test_inspect_mesh.py
- name: Verify CLI help
run: python examples/python/inspect_mesh.py --help
6 changes: 4 additions & 2 deletions .github/workflows/wasm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:
cd src/wasm
mkdir -p build
cd build
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release
emcmake cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DEigen3_DIR=/usr/share/eigen3/cmake

- name: Build WASM
run: |
Expand Down Expand Up @@ -77,7 +79,7 @@ jobs:
- name: Setup Node.js for testing
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'

- name: Run WASM tests
run: |
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

## [Unreleased]

## [1.2.0] - 2026-10-05

### Added
- Explicit boundary halfedges, closed boundary-loop traversal, and topology validation in both mesh cores.
- Constrained Poisson helpers, boundary-aware Gaussian curvature, and open-mesh Gauss–Bonnet tests.
- Implemented C# Heat Method weak-divergence stage and boundary-circle constrained solve.
- Dependency-free Python OBJ inspector with parser, topology, and degeneracy tests.
- Responsive interactive DDG workbench with JavaScript fallback and optional WASM engine.
- Root Vercel routing for the workbench.

### Changed
- Cotangent Laplacians are assembled once per undirected edge and are symmetric by construction.
- Boundary-circle parameterization follows boundary order and uses chord-length spacing.
- Project metadata now reports version 1.2.0.

### Deferred
- True LSCM, harmonic basis generation, ARAP, and formal cross-language parity datasets.

### Changed
- Replaced overstated top-level docs with explicit maturity labels.
- Updated C++/C#/WASM workflow action versions and corrected C# test execution path.
Expand Down
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ Companion implementations and notes for Keenan Crane's *Discrete Differential Ge

> Current state: educational and improving, not production-complete.

[![C++ Build](https://github.com/rhughes42/discrete-differential-geometry-basics/actions/workflows/cpp-build.yml/badge.svg)](https://github.com/rhughes42/discrete-differential-geometry-basics/actions/workflows/cpp-build.yml)
[![C# Build](https://github.com/rhughes42/discrete-differential-geometry-basics/actions/workflows/csharp-build.yml/badge.svg)](https://github.com/rhughes42/discrete-differential-geometry-basics/actions/workflows/csharp-build.yml)
[![WASM Build](https://github.com/rhughes42/discrete-differential-geometry-basics/actions/workflows/wasm-build.yml/badge.svg)](https://github.com/rhughes42/discrete-differential-geometry-basics/actions/workflows/wasm-build.yml)
[![C++ Build](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/cpp-build.yml/badge.svg)](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/cpp-build.yml)
[![C# Build](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/csharp-build.yml/badge.svg)](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/csharp-build.yml)
[![WASM Build](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/wasm-build.yml/badge.svg)](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/wasm-build.yml)
[![Python Checks](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/python-checks.yml/badge.svg)](https://github.com/ryanwhois/discrete-differential-geometry-basics/actions/workflows/python-checks.yml)

## Status Snapshot

| Area | Status | Notes |
|---|---|---|
| C++ core mesh + DDG algorithms | **Partial** | Implemented and buildable; some algorithms use simplified operators/solvers |
| C# core mesh + DDG algorithms | **Partial** | All six algorithm modules exist; several contain placeholder/simplified steps |
| Python tooling | **Experimental** | Lightweight visualization script only |
| Web companion | **Experimental** | WASM demo/benchmark pages, no full `web/index.html` app |
| Test coverage | **Partial** | Good basic unit tests; limited degeneracy/non-manifold stress coverage |
| C++ core mesh + DDG algorithms | **Partial** | Boundary-safe topology, symmetric cotan operators, constrained solves; Hodge bases remain experimental |
| C# core mesh + DDG algorithms | **Partial** | Boundary-safe parity for topology, curvature, Laplacian, Heat divergence, and boundary mapping |
| Python tooling | **Supported utility** | Dependency-free OBJ topology inspector plus optional visualizer |
| Web companion | **Interactive reference** | Responsive workbench with a JS reference engine and optional WASM acceleration |
| Test coverage | **Partial** | Closed/open topology and Gauss–Bonnet coverage; broader parity datasets remain future work |

See `docs/status/IMPLEMENTATION_AUDIT.md` for the detailed audit.

Expand Down Expand Up @@ -57,7 +58,9 @@ dotnet test --configuration Release

### WebAssembly

WASM bindings and demos live under `src/wasm/` and `web/wasm-demo.html` / `web/wasm-benchmark.html`.
WASM bindings and demos live under `src/wasm/`. Open `web/index.html` for
the interactive workbench; it falls back honestly to the JavaScript reference
engine when compiled WASM artifacts are absent.

## Repository Layout

Expand All @@ -67,7 +70,7 @@ src/csharp/ C# core mesh, algorithms, tests, CLI examples
src/wasm/ Emscripten bindings and wasm build config
docs/ Chapters, formulas, assignments, tutorials, status docs
examples/ Example usage notes and Python helper script
web/ Static WASM demo pages
web/ Interactive scientific workbench and legacy WASM pages
```

## Documentation
Expand All @@ -82,17 +85,15 @@ web/ Static WASM demo pages

## Roadmap (Realistic)

### 1.1.x Stabilization (current)
- Mesh robustness and topology validation improvements
- Build/test reliability fixes
- Documentation honesty and audit coverage
- Better numerical safeguards in current algorithms

### 1.2.0 Target
- Reusable Poisson solve infrastructure
- ARAP deformation scaffold (explicitly experimental)
- Expanded degeneracy/non-manifold test set
- Better parity notes across C++/C#/WASM
### 1.2.0 release candidate
- Explicit boundary halfedges and topology validation in C++ and C#
- Symmetric cotan assembly and constrained Poisson infrastructure
- Boundary-aware curvature, Heat divergence, and harmonic disk mapping
- Dependency-free Python inspection and an interactive web workbench

### Later
- True LSCM assembly, harmonic basis generation, and ARAP deformation
- Cross-language parity datasets and larger numerical regression suites

## Contributing

Expand Down
50 changes: 50 additions & 0 deletions docs/status/DETAILED_IMPLEMENTATION_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Detailed Implementation Plan

## Objective

Turn the repository from a collection of educational implementations into a
coherent, testable DDG course companion without overstating numerical maturity.

## Completed dependency order

### 1. Topology foundation

- Validate triangular input, indices, duplicate directed edges, manifold edge
incidence, and degenerate geometry.
- Construct explicit boundary twins and boundary loops.
- Make one-ring traversal safe and consistent in C++ and C#.

### 2. Discrete operators

- Correct opposite-angle cotangent evaluation.
- Assemble symmetric Laplacians once per undirected edge.
- Add reusable Dirichlet-constrained solves.
- Include boundary angle defects in Gaussian curvature.

### 3. Algorithms

- Route Heat Method distance recovery through an anchored Poisson solve.
- Implement the C# weak-divergence stage.
- Replace unordered boundary selection with ordered, chord-length circles.
- Fail explicitly for the still-deferred true LSCM implementation.

### 4. Verification

- Add closed and open topology tests.
- Add boundary Gauss–Bonnet tests.
- Add a dependency-free OBJ inspector and four Python tests.
- Align C++, C#, Python, and WASM CI workflows with the source layout.

### 5. Educational web surface

- Provide a responsive rail–canvas–rail workbench.
- Expose mesh fixtures, algorithm controls, topology metrics, theory, and
diagnostics.
- Use the JS reference engine when WASM output is absent and label the active
engine honestly.
- Add root and `/workbench` routing for Vercel.

## Deferred work

True LSCM, harmonic basis generation, ARAP, sparse production-scale constraint
elimination, and formal parity datasets remain separate milestones.
115 changes: 41 additions & 74 deletions docs/status/IMPLEMENTATION_AUDIT.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,44 @@
# Implementation Audit (v1.1.x Stabilization Pass)
# Implementation Audit — v1.2.0 Candidate

## 1) Implemented Algorithms by Language
## Current capability

| Algorithm | C++ | C# | Status |
| Area | C++ | C# | Maturity |
|---|:---:|:---:|---|
| Cotan Laplacian | ✅ | ✅ | **Partial** |
| Mean Curvature Flow | ✅ | ✅ | **Partial** |
| Discrete Gaussian Curvature | ✅ | ✅ | **Partial** |
| Conformal Parameterization | ✅ | ✅ | **Partial / Experimental** |
| Heat Method | ✅ | ✅ | **Partial / Experimental** |
| Hodge Decomposition | ✅ | ✅ | **Experimental** |

### Notes
- C# `CotanLaplacian` previously used a fixed placeholder weight; now wired through edge cotangent computation, still requiring deeper validation on irregular meshes.
- C# `HeatMethod` still has a placeholder divergence stage.
- C# `ConformalParameterization.BoundaryCircle` still uses a partial constrained solve approach.
- C++ `HodgeDecomposition` includes simplified Hodge star and placeholder tree-cotree behavior.

## 2) Missing / Partial Algorithms

- ARAP deformation: **Planned**
- Reusable Poisson solver API: **Planned** (Poisson solve exists only as helper path in cotan module)
- Robust harmonic basis generation: **Partial/Experimental**
- Full DEC operator validation suite: **Partial**

## 3) Build Status

| Component | Status | Evidence |
|---|---|---|
| C++ | Improved, now configures with existing tests list | Fixed broken test target references in `src/cpp/tests/CMakeLists.txt` |
| C# | Builds cleanly | `dotnet build --configuration Release` |
| Python | Minimal utilities only | `examples/python/visualize_mesh.py` |
| Web/WASM | Workflow exists; demo pages available | `web/wasm-demo.html`, `web/wasm-benchmark.html` |

## 4) Test Status / Gaps

### Current strengths
- Mesh construction/connectivity checks.
- Laplacian dimensions, row sums, and symmetry checks.
- Gauss-Bonnet sanity checks.

### Gaps
- Degenerate triangle stress tests are limited.
- Invalid/non-manifold topology coverage remains limited.
- Heat method and hodge decomposition need stronger numerical regression tests.
- Cross-language parity tests are not formalized.

## 5) README/Docs Drift Found and Corrected

Corrected claims:
- Removed “production-ready / complete / 95%+ coverage” style overclaims.
- Removed references to missing `web/index.html`.
- Corrected chapter and assignment availability references.
- Added explicit maturity labels: **Complete / Partial / Experimental / Planned**.

## 6) Numerical and Geometric Correctness Risks

1. Orientation assumptions in halfedge traversal remain strict in many operators.
2. Boundary and non-manifold treatment remains incomplete for advanced algorithms.
3. Sparse solves do not consistently include rank-deficiency handling and conditioning diagnostics.
4. Heat method divergence integration in C# remains incomplete.
5. Hodge stars in both languages include simplified approximations.

## 7) Priority Technical Debt

1. Topology validation API (manifoldness, orientation consistency, duplicate edges).
2. Robust boundary halfedge handling in both language cores.
3. Centralized epsilon/tolerance policy for geometric predicates.
4. Unified Poisson/linear-solve abstraction with failure diagnostics.
5. Broader algorithm verification suite (sphere/grid/open meshes/degenerates).

## 8) Suggested Roadmap Sequence

1. **1.1.x stabilization**: mesh validation, tests, docs honesty, CI reliability.
2. **1.2.0 feature expansion**: Poisson infrastructure + ARAP scaffold (explicitly experimental).
3. **Post-1.2**: stronger DEC operator completeness, parity tests, richer tutorials and visual diagnostics.
| Explicit manifold boundary topology | Yes | Yes | Validated on closed and disk fixtures |
| Cotan Laplacian and barycentric mass | Yes | Yes | Symmetric assembly; broader conditioning tests needed |
| Constrained Poisson solve | Yes | Yes | Dense constraint elimination; suitable for educational-scale meshes |
| Gaussian curvature | Yes | Yes | Interior and boundary angle defects; Gauss–Bonnet tests |
| Mean curvature flow | Yes | Yes | Implemented; solver diagnostics and boundary policies need expansion |
| Boundary-circle parameterization | Yes | Yes | Ordered, chord-length boundary with constrained harmonic solve |
| Heat Method | Yes | Yes | Heat, normalized face gradient, weak divergence, anchored Poisson |
| Hodge decomposition | Partial | Partial | Decomposition exists; harmonic bases and full DEC validation deferred |
| Interactive web workbench | JS + optional WASM | — | Reference/educational surface |

## Correctness changes in this release

- Every manifold edge owns two halfedges; open edges receive an explicit
boundary twin and boundary halfedges form closed loops.
- Duplicate directed edges, non-manifold edges, invalid indices, degenerate
faces, and incomplete pointer relations are rejected or reported.
- Cotangent weights are evaluated at the angle opposite each edge and inserted
symmetrically.
- Boundary Gaussian curvature uses the \(\pi-\sum\theta\) defect, so disk
meshes satisfy Gauss–Bonnet.
- Singular Poisson systems are anchored through explicit Dirichlet constraints.
- The C# Heat Method no longer returns the zero-divergence placeholder result.

## Deliberately deferred

- True least-squares conformal maps (the C++ entry point fails explicitly
instead of presenting a harmonic map as LSCM).
- Harmonic one-form basis construction and tree–cotree generators.
- ARAP deformation.
- Production-scale sparse constraint elimination, preconditioners, and
cross-language golden datasets.

## Verification

- Python: four dependency-free parser/topology tests.
- JavaScript: syntax and deployed interaction checks.
- Native compilation: required through the C++, C#, and WASM GitHub Actions
matrices because those toolchains are not available in the recovery runtime.
52 changes: 18 additions & 34 deletions docs/status/NEXT_RELEASE_PLAN.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,26 @@
# Next Release Plan

## Recommended Version Bump
## Release decision

**Recommend: `1.1.1`**
The current branch is a **v1.2.0 candidate**. It crosses the minor-release
threshold by adding explicit boundary topology, reusable constrained solves,
implemented Heat divergence, and a new interactive web application.

Reasoning:
- This pass focuses on stabilization, test/build reliability fixes, and documentation correctness.
- No intentional breaking API redesign was introduced.
- Major new capabilities like ARAP/Poisson infrastructure are not yet complete enough for `1.2.0`.
## Release gates

## Included in this stabilization pass
1. All C++, C#, Python, and WASM workflows pass on the pull request.
2. Closed tetrahedron and open disk invariants pass in both language cores.
3. Cotan matrices remain symmetric with near-zero row sums.
4. Open-disk curvature has a near-zero Gauss–Bonnet residual.
5. The deployed workbench loads at both `/` and `/web/index.html`.
6. No documentation describes deferred LSCM, harmonic bases, or ARAP as complete.

- C++ build/test reliability fixes (test target correctness, warning policy improvements).
- C# mesh robustness improvements and defensive traversal safety.
- Test updates for oriented tetrahedra and invalid index rejection.
- CI workflow alignment (action versions, .NET version, test path correctness).
- Documentation audit and maturity relabeling.
## Post-1.2 priorities

## Outstanding Risks
1. Establish versioned cross-language mesh fixtures and golden outputs.
2. Replace dense constraint elimination with sparse reduced systems.
3. Implement and validate true LSCM.
4. Implement tree–cotree generators and harmonic bases.
5. Add ARAP only after solver and parity infrastructure are stable.

- Heat method and hodge decomposition remain partial/experimental.
- Non-manifold and severe degeneracy handling is still incomplete.
- Cross-language parity and numerical baseline tests are still limited.

## Suggested GitHub Issues

1. Add explicit mesh topology validator (orientation, manifoldness, duplicates).
2. Add Poisson solver API with Dirichlet constraints and tests.
3. Complete C# heat-method divergence stage.
4. Improve Hodge star and harmonic basis implementations.
5. Add stress tests for open meshes, disconnected meshes, and near-degenerate triangles.

## Proposed Milestones

### Milestone: v1.1.1
- Reliability/documentation/test integrity fixes only.

### Milestone: v1.2.0
- Poisson solver infrastructure
- ARAP scaffold
- Expanded algorithm validation suite
These are intentionally separate from the 1.2.0 release candidate.
Loading
Loading