Expand description
Minkowski sum and difference of planar-faced solids.
§The convex case is the tractable one
The Minkowski sum of two convex polyhedra is the convex hull of their
pairwise vertex sums. That is exact, needs no boolean solver, and is
what minkowski_sum computes.
Non-convex operands have no such shortcut. The standard construction
decomposes both into convex parts, sums every pair, and unions the
results — which is why minkowski_sum_with takes a boolean provider.
Cost is the product of the part counts, so it is budgeted rather than
left to run away.
§Difference is not the sum run backwards
A ⊖ B is the set of translations that keep B inside A:
{ x : x + B ⊆ A }. It is an erosion, not a hull of pairwise
differences, and computing it as one is a common and silent error.
When A is convex the containment test reduces to the vertices of B,
because a convex A containing every x + vᵢ contains their hull and
therefore all of x + B. That gives
A ⊖ B = ⋂ᵢ (A − vᵢ) over the vertices vᵢ of Bwhich is exact and computable with intersections alone. For non-convex
A the reduction fails — A can contain each translated vertex while
missing the material between them — so minkowski_difference_with
refuses a non-convex subject by name rather than returning a result that
is too large.
§Curved operands
Both operations are defined here for planar-faced solids. A curved operand is refused, matching the rest of the offset work: the sum of two curved solids is not a polyhedron and approximating it silently would misreport what the result is.
Structs§
- Minkowski
Evidence - What was done to produce a Minkowski result.
- Minkowski
Outcome - A Minkowski result and what it took to produce.
Enums§
- Minkowski
Error - Why a Minkowski operation could not be performed.
Functions§
- minkowski_
difference_ with - Minkowski difference: the translations of
toolthat stay insidesubject. - minkowski_
sum - Minkowski sum of two CONVEX planar-faced solids.
- minkowski_
sum_ with - Minkowski sum of two planar-faced solids, convex or not.