adze/adze
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-01 22:58:01 -07:00
..
test [tests] remove leftover rebase markers 2026-04-01 22:58:01 -07:00
__init__.py [offset] add offset_anisotropic 2026-03-07 23:53:59 -08:00
boolean.py [boolean] Add boolean operations 2026-03-07 07:30:43 -08:00
boundary.py [build_polyhedron] better validate inputs and correctly handle non-triangular faces 2026-04-01 22:54:41 -07:00
LICENSE.md move to hatch-based build 2022-08-18 23:47:26 -07:00
moments.py [moments] Error if order is negative or non-integer 2026-04-01 22:47:43 -07:00
offset.py [offset] add offset_anisotropic 2026-03-07 23:53:59 -08:00
README.md move to hatch-based build 2022-08-18 23:47:26 -07:00
shapes.py more input validation 2026-04-01 22:52:47 -07:00
split.py more input validation 2026-04-01 22:51:43 -07:00
test_results.txt Use pytest for tests 2020-03-15 22:18:02 -07:00
transform.py [transform] improve handling of integer coordinates and general input handling 2026-04-01 22:54:41 -07:00
util.py [find_faces] handle empty poly 2026-04-01 22:41:39 -07:00
voxel.py [voxelize] Enforce 3 planes 2026-04-01 22:45:47 -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)