2020-03-15 23:15:18 -07:00
|
|
|
# adze
|
2018-04-19 20:15:01 -07:00
|
|
|
|
|
|
|
|
**adze** is a Python package for accurate polyhedron clipping
|
|
|
|
|
and anti-aliased voxelization.
|
|
|
|
|
|
|
|
|
|
**Homepage:** https://mpxd.net/code/jan/adze
|
|
|
|
|
|
|
|
|
|
**Capabilities:**
|
2026-03-07 00:46:27 -08:00
|
|
|
- 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.
|
2018-04-19 20:15:01 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
**Dependencies:**
|
2026-03-07 00:46:27 -08:00
|
|
|
* python 3.11 or newer
|
2018-04-19 20:15:01 -07:00
|
|
|
* numpy
|
2020-03-15 23:15:18 -07:00
|
|
|
* pytest (optional, testing)
|
|
|
|
|
* pytest-benchmark (optional, benchmarking)
|
2018-04-19 20:15:01 -07:00
|
|
|
|
|
|
|
|
Install with pip from PyPi (preferred):
|
|
|
|
|
```bash
|
2026-03-07 00:46:27 -08:00
|
|
|
pip install adze
|
2018-04-19 20:15:01 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Install directly from git repository:
|
|
|
|
|
```bash
|
2026-03-07 00:46:27 -08:00
|
|
|
uv pip install git+https://mpxd.net/code/jan/adze.git
|
2018-04-19 20:15:01 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
Most functions and classes are documented inline.
|
|
|
|
|
|
2026-04-01 19:20:00 -07:00
|
|
|
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.
|
|
|
|
|
|
2018-04-19 20:15:01 -07:00
|
|
|
To read the inline help,
|
|
|
|
|
```python3
|
|
|
|
|
import adze
|
|
|
|
|
help(adze)
|
|
|
|
|
help(adze.split)
|
|
|
|
|
```
|