Spatium
github.com/vaniell0/spatium- Category
- Developer Tools
- Rank
- No. 1892Tools index
Previous survey · No. 1832 ·
- Pricing
- Open Source
- Type
- TOOL
- GitHub
- 4 stars
- Latest release
- v1.0.0
- Date
About
Spatium is a C++23 header-only library for computational geometry and physics that treats the underlying mathematical space, such as Euclidean, spherical, hyperbolic, or a custom surface, as a first-class, swappable concept rather than assuming flat R^N as CGAL, Eigen, or GLM do. This lets the same geometric and physics code run on different manifolds, for example computing geodesics on a sphere or distances in hyperbolic space, without rewriting the underlying algorithms.
At a glance
Spatium is a C++23 library for geometry that can follow the rules of a curved space. A sphere supplies distances along its surface, for example, rather than straight lines through it. Its mostly header-only core lets geometry algorithms use those rules; optional solvers, data and a Vulkan viewer add dependencies or compiled components.
Good fit
Consider it for simulation or mesh work where the space itself changes the calculation. Its small sphere example makes that distinction concrete: the documented distance from the north pole to the equator on a unit sphere is π/2. A custom space can provide the same operations for your own geometry.
Consider something else when
Your project needs an older C++ toolchain, complete C++ module support or equally accelerated searches on every curved surface. Spatium’s spatial acceleration structures remain Euclidean. Operations on other spaces can use exhaustive searches, so the geometric abstraction does not promise the same performance everywhere.
Start here
With CMake 3.28 or newer and GCC 15 or Clang 19, start in examples/external-consumer. The documented sequence is cmake -B build, cmake --build build, then ./build/sphere_distance_demo. Expect a distance of 1.570796. This consumer builds the core without the viewer or optional solvers; adapt it before enabling the larger standalone build.
Cost and requirements
The Apache-2.0 source has no licence fee. The minimal consumer needs the C++23 toolchain and fetches Spatium from its main branch during configuration. Boost is opt-in in the current build, despite an older required-dependency sentence in the root README. Eigen is needed for the heat-method distance solver and discrete differential operators.
Limits to know
The broader repository includes research tools and optional GPU work beyond the core geometry interface. A successful sphere example would establish basic integration, not validate those features or a production simulation. The C++ module interface also trails the header implementation; check the particular algorithm and build options your project needs.
Why it made the leaderboard
It lets C++ developers do geometry and physics computation on non-Euclidean spaces (spheres, hyperbolic geometry) without switching libraries or hand-rolling manifold math.
Tags
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.