Library / SDK
nmwsharp/geometry-central avatar
nmwsharp/geometry-central

geometry-central for C++ surface mesh processing

Applied 3D geometry in C++, with a focus on surface meshes.

1,343 stars185 forksC++MIT

At a glance

What is it?
geometry-central is a C++ library centered on editable surface meshes, discrete geometry, intrinsic triangulations, and sparse linear algebra. It suits research and application code that needs more mesh infrastructure than a minimal I/O library, but its dependency and API surface require evaluation first.
Who is it for?
Adopt geometry-central when the application needs an editable surface mesh, attached per-element data, discrete differential geometry, and related algorithms within one C++ environment. Do not adopt it as a lightweight OBJ reader or when the surrounding project cannot absorb its C++ library and build-system dependencies.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 131 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The surface mesh scope of geometry-central

geometry-central solves a broader problem than loading a triangle mesh. It provides C++ data structures and algorithms for geometry processing, with particular emphasis on surface meshes. The intended users are engineers and researchers implementing operations over vertices, edges, faces, geometry attached to those elements, differential operators, direction fields, or intrinsic triangulation changes. A conventional mesh loader can read a file, but it may leave the application to define mesh mutation, topology access, element-indexed storage, and the relationship between a combinatorial mesh and its embedded geometry.

The library separates those concerns. The README identifies a `SurfaceMesh` class with support for mesh modification and containers for associating data with mesh elements. It also provides `VertexPositionGeometry`, which represents geometric information alongside the topology. This distinction matters because changing a surface mesh can involve connectivity rather than only coordinate values. The project description and documentation place the library in applied 3D geometry, but its documented feature set is most concrete for polygonal surface topology.

That focus creates a clear boundary. The README does not claim support for volumetric tetrahedral meshes, scene graphs, rendering, animation, or general-purpose asset pipelines. It also does not establish that geometry-central is a replacement for a complete graphics engine. It is better understood as computational geometry infrastructure for code that must reason about and modify a surface mesh. Rendering and final application integration remain separate concerns unless another library supplies them.

Mesh topology, geometry, and element data flow

The visible architecture starts with a mesh object that exposes topological elements and adjacency. In the README example, `readSurfaceMesh("spot.obj")` returns both a `SurfaceMesh` and a `VertexPositionGeometry`. Once face areas have been required through `geometry->requireFaceAreas()`, the code iterates over each vertex, visits its adjacent faces, divides each face area by the vertex degree, and stores the sum in `VertexData<double>`.

That example shows the library's main data flow. Topology supplies iterable handles such as `Vertex` and `Face`, adjacency defines which faces meet a vertex, the geometry object computes a required quantity, and typed element data stores a result indexed by mesh entities. The calculation is not a built-in vertex-area routine in the shown example. It is application code assembled from the library's interfaces. This makes the structure useful for custom algorithms while also showing that not every derived measure comes as a single method.

Geometry quantities include normals, curvatures, tangent vector bases, and operators from discrete differential geometry. Algorithms include surface distance computation, direction-field generation, and manipulation of intrinsic Delaunay triangulations. The sparse linear algebra layer is based on Eigen and is described as able to use better solvers when they are available on the system. The repository layout, with `include/`, `src/`, `deps/`, `cmake/`, `docs/`, and `test/`, is consistent with a compiled library plus bundled documentation and test code. The exact module boundaries are not documented in the README, so the public headers should be treated as the authoritative API map during evaluation.

Building geometry-central and running the README example

The README does not provide a direct install command. It directs users to the documentation and build instructions at `http://geometry-central.net`. A separate sample repository, `gc-polyscope-project-template`, is named as the starting point for a build system and graphical interface. The repository also contains `CMakeLists.txt` and a `cmake/` directory, which indicate a CMake-based build, but the README does not state the required CMake version, compiler settings, dependency installation commands, or supported configuration flags. Supplying those details would be guesswork.

The first concrete operation shown is loading `spot.obj` and computing vertex areas. In a configured C++ project, the relevant sequence is the following. `readSurfaceMesh` creates the mesh and geometry pair, `requireFaceAreas` asks the geometry object to make face areas available, and `VertexData<double>` stores one value per vertex. The loop then aggregates adjacent face contributions according to the vertex degree.

cpp
// Load a mesh
std::unique_ptr<SurfaceMesh> mesh;
std::unique_ptr<VertexPositionGeometry> geometry;
std::tie(mesh, geometry) = readSurfaceMesh("spot.obj"); 

// Compute vertex areas
VertexData<double> vertexAreas(*mesh);

The README continues by requiring face areas and populating the attached data. After the file is available at the expected path and the project links against geometry-central, a successful operation should expose each vertex's computed value through `vertexAreas[v]`.

cpp
geometry->requireFaceAreas();
for(Vertex v : mesh->vertices()) {
  double A = 0.;
  for(Face f : v.adjacentFaces()) {
    A += geometry->faceAreas[f] / v.degree();
  }
  vertexAreas[v] = A;
}

This example does not include a `main` function, compilation flags, includes, or a command that launches a program. The project template is therefore the documented entry point for assembling a runnable build rather than the README snippet alone.

Intrinsic triangulation and differential geometry trade-offs

geometry-central is most relevant when an application operates on intrinsic surface properties or needs mesh topology to change as part of the computation. The documented algorithm set includes intrinsic Delaunay triangulation manipulation. That signals support for geometry-processing workflows in which connectivity and metric information interact, rather than a fixed indexed triangle buffer with a few utility functions.

The discrete differential geometry layer provides quantities such as normals, curvature, tangent bases, and operators. These abstractions can reduce the amount of custom indexing code in a research implementation. They also commit the application to geometry-central's representations and update rules. If coordinates change after a quantity has been computed, callers need to understand whether invalidation or recomputation is required. The README names `requireFaceAreas`, which indicates lazy requirement for at least some geometry, but it does not explain the complete cache lifecycle.

Sparse linear algebra is another dependency boundary. The tools are based on Eigen, with automatic use of better solvers when available. That design can make the same source portable across systems with different solver capabilities, yet it also makes configuration and numerical behavior relevant to deployment. The README does not name those optional solvers or state fallback behavior. Projects with strict reproducibility requirements should inspect that part of the documentation before assuming that results or performance will be identical across machines.

The cost of adopting a compiled geometry library

The repository is not archived, and the last push was on 2026-06-13. Recent releases include `v1.1.0` on 2026-05-19, `v1.0.0` on 2025-04-02, and `v0.1.0` on 2021-07-29. These facts indicate recent release and repository activity, but the README does not publish a compatibility policy, long-term-support branch, ABI policy, or migration guide. An upgrade therefore needs source-level review rather than an assumption that every `v1.x` update is drop-in.

geometry-central uses the MIT license. That is permissive and generally compatible with a wide range of proprietary and open-source distributions, subject to the actual license text and third-party obligations. The library also relies on Eigen and may use other solver libraries available on the system. Those dependencies have their own distribution terms. This is not legal advice, and the README does not enumerate every bundled dependency or its license.

Operationally, adoption cost is more visible than upgrade frequency. C++ developers must configure a native build, satisfy compiler and platform requirements documented outside the README, and decide how to integrate mesh mutation and sparse solving with the rest of the application. The sample project template can reduce initial build work, but it also shows that a separate project configuration is expected. Teams should inspect `CMakeLists.txt`, the selected template, and dependency instructions before estimating integration effort.

geometry-central versus minimal mesh and geometry libraries

The README names CGAL, libigl, OpenMesh, the Polygon Mesh Processing Library, and CinoLib as related alternatives. Their presence is not a feature comparison, and the README does not document their APIs or performance. A concrete difference can still be drawn from geometry-central's own scope: it combines an editable surface mesh, element-attached data, geometric quantities, higher-level algorithms, and sparse linear algebra in one described library.

A workload centered only on mesh topology and file exchange may not need the broader geometry-processing stack. A workload based on discrete differential geometry, surface distances, direction fields, or intrinsic Delaunay triangulations is more likely to use the parts that give geometry-central its particular shape. The decision should therefore be based on whether those interfaces remove custom code from the application, not on the number of features advertised by either project.

libigl is listed as a related alternative, but the README does not state how its mesh mutability, algorithms, data containers, or solver integration compare with geometry-central. OpenMesh is also listed, but no corresponding comparison is provided. Claiming that one is faster, lighter, or easier would exceed the README. The defensible project-specific distinction is that geometry-central explicitly couples mutable surface topology with attached geometric data and built-in discrete geometry operations.

Editorial conclusion

Adopt geometry-central when the application needs an editable surface mesh, attached per-element data, discrete differential geometry, and related algorithms within one C++ environment. Do not adopt it as a lightweight OBJ reader or when the surrounding project cannot absorb its C++ library and build-system dependencies. Before adoption, inspect the host platform documentation, required dependencies, solver availability, and the exact operations expected from the mesh and geometry interfaces.

Frequently asked questions

What is geometry-central used for?

It is a C++ library for geometry processing, especially surface mesh modification, element-associated data, geometric quantities, and algorithms such as surface distances and intrinsic Delaunay triangulation manipulation.

How do I build geometry-central?

The README directs users to the build instructions at `http://geometry-central.net` and points to the `gc-polyscope-project-template` sample project for a build system and GUI.

Does geometry-central require Eigen?

The README states that its sparse linear algebra tools are based on Eigen and can use better solvers when they are available on the system. It does not provide the installation commands.

Official sources

  1. License: MIT
  2. nmwsharp/geometry-central on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/nmwsharp-geometry-central.svg)](https://hysenlabs.com/projects/nmwsharp-geometry-central)

Was this useful?