Documentation update

This commit is contained in:
jan 2026-03-07 00:46:27 -08:00
commit bf057e2505
2 changed files with 28 additions and 19 deletions

View file

@ -6,28 +6,27 @@
**Homepage:** https://mpxd.net/code/jan/adze **Homepage:** https://mpxd.net/code/jan/adze
**Capabilities:** **Capabilities:**
- Clipping or splitting arbitrary polyhedra - Clipping or splitting arbitrary polyhedra by a plane or a collection of planes (i.e. a convex polyhedron).
- 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.
- Voxelizing arbitrary polyhedra - Calculation of polynomial moments (volume, centroid, inertia, etc.) for clipped polyhedra.
-
## Installation ## Installation
**Dependencies:** **Dependencies:**
* python 3.6 or newer * python 3.11 or newer
* numpy * numpy
* pytest (optional, testing) * pytest (optional, testing)
* pytest-benchmark (optional, benchmarking) * pytest-benchmark (optional, benchmarking)
Install with pip from PyPi (preferred): Install with pip from PyPi (preferred):
```bash ```bash
pip3 install adze pip install adze
``` ```
Install directly from git repository: Install directly from git repository:
```bash ```bash
pip3 install git+https://mpxd.net/code/jan/adze.git@release uv pip install git+https://mpxd.net/code/jan/adze.git
``` ```
## Documentation ## Documentation

View file

@ -38,18 +38,28 @@ Helper functions include
-------------------------- --------------------------
In the polyhedron representation returned by the build_* functions and accepted by ### Internal Representation: The Schlegel Diagram
most other functions (split, clip, get_volume, get_moments, voxelize), the
polyhedron is stored as a 3-vertex-connected, triply-linked graph, with each vertex's
neighbors listed in counterclockwise order when viewed from outside the polyhedron. TODO
Each graph-vertex (g-vertex) is connected to exactly 3 other g-vertices; polygon-
vertices (p-vertices) are
adze represents 3D shapes (polyhedra) using a specialized graph called a Schlegel
diagram. This format is designed for high-performance geometric calculations.
TODO #### Key Features:
This representation looks like - **Exactly Three Neighbors:** Every vertex in the graph is connected to exactly
poly = {'neighbors': ndarray[Px3, int], 'vertices': ndarray[Px3, float]} three other vertices. This "3-regular" property makes algorithms for clipping and
where poly['neighbors'] contains splitting shapes much simpler and more robust.
- **Ordered Adjacency:** For each vertex, the three neighbors are listed in
counter-clockwise order when viewed from outside the shape. This order defines
the "orientation" of the shape's surfaces.
- **Handling Complex Corners:** In real-world shapes, a corner (vertex) might have
more than three edges meeting (e.g., the tip of a pyramid). adze handles this by
creating multiple "copy" vertices at the same physical location, each handling
part of the original corner's connectivity.
#### Data Structure:
Shapes are stored as a dictionary containing two NumPy arrays:
- `poly['vertices']`: An `[N x 3]` array of float coordinates (X, Y, Z).
- `poly['neighbors']`: An `[N x 3]` array of integer indices.
`poly['neighbors'][i, :]` contains the indices of the 3 vertices connected to vertex `i`.
""" """