Skip to content

geometry · Module functions

3 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.

Worked example

The complete checked program Recover the exact face structure of a rational square uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Recover the exact face structure of a rational square."""

from fractions import Fraction

from noether.geometry import convex_hull


def main() -> None:
    square = convex_hull([[0, 0], [1, 0], [0, 1], [1, 1], [Fraction(1, 2), Fraction(1, 2)]])
    square.verify()
    assert square.f_vector == [1, 4, 4, 1]
    assert not square.is_vertex([Fraction(1, 2), Fraction(1, 2)])
    print(f"vertices={square.vertices}; f-vector={square.f_vector}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/25_exact_geometry.py.

geometry.convex_hull

Return the exact rational convex hull of a finite point family.

(points: Iterable[Iterable[int | Fraction]]) -> Polytope

noether::geometry::convex_hull · Direct Rust declaration

pub fn convex_hull(points: &[Vec<Rational>]) -> Result<Polytope, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Dispatch / backing convex-hull, flint
GIL released
Evidence Polytope.verify
Failures empty point family, inconsistent ambient dimensions

Executable usage: examples/25_exact_geometry.py:11 · examples/25_exact_geometry.py:7 · validation/unit/geometry/test_acceptance_workload.py:49 · validation/unit/geometry/test_acceptance_workload.py:9 · validation/unit/geometry/test_polytope_facade.py:10 · validation/unit/geometry/test_polytope_facade.py:14

Example

from noether.geometry import convex_hull
result = convex_hull([[0, 0], [1, 0], [0, 1]])
result.verify()

geometry.delaunay

Return the exact-predicate Delaunay triangulation of points.

(points: PointCloud | Iterable[Iterable[float]]) -> Triangulation

noether::geometry::delaunay · Direct Rust declaration

pub fn delaunay(points: &PointCloud) -> Result<Triangulation, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded

Executable usage: validation/unit/geometry/test_acceptance_workload.py:25 · validation/unit/geometry/test_acceptance_workload.py:44 · validation/unit/geometry/test_geometry_facade.py:53 · validation/unit/geometry/test_geometry_facade.py:58 · validation/unit/geometry/test_geometry_facade.py:79 · validation/unit/geometry/test_geometry_facade.py:9

geometry.regular_triangulation

Return the regular triangulation with one finite weight per site.

(points: PointCloud | Iterable[Iterable[float]], weights: Sequence[float]) -> Triangulation

noether::geometry::regular_triangulation · Direct Rust declaration

pub fn regular_triangulation( points: &PointCloud, weights: &[f64], ) -> Result<Triangulation, GeometryError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, geom-core, convex-hull
GIL attached / bounded

Executable usage: validation/unit/geometry/test_acceptance_workload.py:26 · validation/unit/geometry/test_geometry_facade.py:54 · validation/unit/geometry/test_geometry_facade.py:73 · validation/unit/geometry/test_geometry_facade.py:75 · validation/unit/geometry/test_geometry_facade.py:9 · validation/unit/topology/test_filtration_builders.py:81