From 4da3376e631f3bc104fb605d19ff6a2d7f8b58d8 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 1 Apr 2026 21:02:51 -0700 Subject: [PATCH] [affine] update docs --- README.md | 1 + adze/transform.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f259368..79bae52 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ 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, ```python3 diff --git a/adze/transform.py b/adze/transform.py index 730d452..667d0da 100644 --- a/adze/transform.py +++ b/adze/transform.py @@ -65,11 +65,13 @@ def scale(poly: poly_t, factor: ArrayLike | float) -> poly_t: def affine(poly: poly_t, xform: ArrayLike) -> poly_t: """ - Perform arbitrary affine trasnformation on the polyhedron. + Perform an arbitrary homogeneous 4x4 transformation on the polyhedron. Args: poly: Polyhedron to transform. Changed in-place. - xform: 4x4 affine transformation matrix. + xform: 4x4 homogeneous transformation matrix. The transformed homogeneous + coordinates are divided by the fourth row, so projective transforms are + supported in addition to affine ones. Returns: Transformed polyhedron.