Python polyhedron clipping library
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-01 22:54:41 -07:00
adze [build_polyhedron] better validate inputs and correctly handle non-triangular faces 2026-04-01 22:54:41 -07:00
.gitignore more timing 2018-03-09 17:15:30 -08:00
LICENSE.md add license and manifest 2018-04-05 12:13:17 -07:00
pyproject.toml misc cleanup and testing deps 2026-03-07 06:49:49 -08:00
README.md [affine] update docs 2026-04-01 22:51:43 -07:00

adze

adze is a Python package for accurate polyhedron clipping and anti-aliased voxelization.

Homepage: https://mpxd.net/code/jan/adze

Capabilities: - Clipping or splitting arbitrary polyhedra by a plane or a collection of planes (i.e. a convex polyhedron). - Accurate anti-aliased voxelization of arbitrary polyhedra on non-uniform rectangular grids. - Calculation of polynomial moments (volume, centroid, inertia, etc.) for clipped polyhedra.

Installation

Dependencies:

  • python 3.11 or newer
  • numpy
  • pytest (optional, testing)
  • pytest-benchmark (optional, benchmarking)

Install with pip from PyPi (preferred):

pip install adze

Install directly from git repository:

uv pip install git+https://mpxd.net/code/jan/adze.git

Documentation

Most functions and classes are documented inline.

Geometry helper input contracts:

  • build_tetrahedron() and planes_from_tetrahedron() expect tetrahedron vertices in the helper's documented positive winding.
  • build_box() and planes_from_box() expect box_corners[0] to be the per-axis minimum and box_corners[1] the per-axis maximum.
  • adze.transform.affine() accepts a general 4x4 homogeneous transform and applies the perspective divide using the fourth row, so projective transforms are supported.

To read the inline help,

import adze
help(adze)
help(adze.split)