Tarik Moussa bf9c323d60 feat(phase3a): introduce CGAL Surface_mesh as ConformalMesh foundation
Replaces the Java CoHDS with CGAL::Surface_mesh<Point3> (Simple_cartesian
kernel). Adds domain-specific property maps for lambda/theta/idx/alpha and
face geometry type — the direct C++ equivalent of CoVertex/CoEdge adapters.

New files:
  include/conformal_mesh.hpp   — ConformalMesh type + property-map helpers
  include/mesh_builder.hpp     — mesh factories (triangle, tetrahedron,
                                 quad-strip, fan) for tests and examples
  tests/cgal/                  — second test executable (conformallab_cgal_tests)
                                 built only with -DWITH_CGAL=ON

Test results (local, -DWITH_CGAL=ON):
  conformallab_tests:      36 registered | 23 passed | 13 skipped | 0 failed
  conformallab_cgal_tests: 14 registered | 14 passed |  0 skipped | 0 failed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 18:36:21 +02:00
2026-02-09 18:39:03 +01:00

conformallab++

conformallab++ is a modern C++ reimplementation of the ConformalLab software by Stefan Sechelmann for experiments in discrete conformal geometry and related mesh transformations.

Status: early prototype stage. API, file formats, and CLI are subject to change.

Features

  • Discrete conformal geometry utilities (Clausen function, hyper-ideal tetrahedra, surface curves)
  • Mesh I/O and conversion using CGAL — optional, only needed for the CLI app
  • Linear algebra routines with Eigen
  • Interactive mesh viewer using libigl / GLFW — optional
  • Lightweight CLI with CLI11 and JSON configuration

Build modes

The project uses three clearly separated CMake modes so you only pull in what you need.

Mode CMake flag What gets built
Tests only (default, used in CI) (none) conformallab_tests · deps: Eigen + GTest
Viewer -DWITH_VIEWER=ON viewer library · deps: libigl / GLFW / GLAD + Eigen
Full app -DWITH_CGAL=ON conformallab_core CLI + viewer · deps: CGAL + libigl / GLFW / GLAD + Eigen

-DWITH_CGAL=ON automatically enables WITH_VIEWER because the CLI app uses the viewer library for mesh visualisation.

External dependencies ship as tarballs in code/deps/tarballs/ and are extracted lazily at CMake configure time — no internet access needed after cloning (GTest is the only exception: fetched from GitHub via FetchContent).

Prerequisites

Tool Minimum version
C++ compiler (GCC or Clang) C++17
CMake 3.20

No system-level libraries are required for the default tests-only build. CGAL and libigl are header-only and bundled in the repo.

Getting started

git clone https://codeberg.org/TMoussa/ConformalLabpp
cd ConformalLabpp

Tests only (CI default)

cmake -S code -B build
cmake --build build --target conformallab_tests -j$(nproc)
ctest --test-dir build --output-on-failure

Full CLI app (CGAL + viewer)

cmake -S code -B build -DWITH_CGAL=ON
cmake --build build -j$(nproc)
./code/bin/conformallab_core --input data/off/example.off --show

Viewer only (no CGAL)

cmake -S code -B build -DWITH_VIEWER=ON
cmake --build build --target viewer -j$(nproc)

Project structure

code/
├── include/               # Public headers (Clausen, hyper-ideal, mesh utils, …)
├── src/
│   ├── apps/v0/           # conformallab_core CLI app (requires WITH_CGAL)
│   └── viewer/            # simple_viewer (requires WITH_VIEWER)
├── tests/                 # GTest unit tests (always built)
└── deps/
    ├── tarballs/          # Bundled dependency archives
    ├── eigen-3.4.0/       # Header-only linear algebra (always extracted)
    ├── CGAL-6.1.1/        # Header-only geometry (extracted with WITH_CGAL)
    ├── libigl-2.6.0/      # Header-only viewer toolkit (extracted with WITH_VIEWER)
    ├── glfw-3.4/          # Windowing (extracted with WITH_VIEWER)
    ├── libigl-glad/       # OpenGL loader (extracted with WITH_VIEWER)
    └── single_includes/   # CLI11, json.hpp

CI

Tests run automatically on push to main, dev, and claude/** branches via a self-hosted Gitea Actions runner (eulernest, ARM64 Raspberry Pi). The pipeline uses a minimal Docker image (git.eulernest.eu/conformallab/ci-cpp:latest) with cmake, g++, git, and Node.js 20 pre-installed.

The Dockerfile for the CI image lives in .gitea/docker/Dockerfile.ci-cpp. Build and push it once whenever the image needs updating:

docker buildx build \
  --platform linux/arm64 \
  -f .gitea/docker/Dockerfile.ci-cpp \
  -t git.eulernest.eu/conformallab/ci-cpp:latest \
  --push \
  .gitea/docker/

License

conformallab++ is released under the MIT License (see LICENSE).

Description
ConformalLab C++ port
Readme MIT 235 MiB
Languages
C++ 94.8%
Shell 2.7%
CMake 1.4%
Python 0.9%
C 0.2%