![]() |
Pangolin
Header-only C++20 plane computational geometry library
|
Shape pairs whose Minkowski sum Pangolin can represent. More...
#include <forward.hpp>
Shape pairs whose Minkowski sum Pangolin can represent.
The sum A ⊕ B is supported when
A runtime-polymorphic Shape on either side is always accepted; the pair of stored alternatives is only checked when the sum is evaluated.
A non-convex operand is excluded from the unbounded case, and only from it: a half-plane is the one unbounded shape whose sum forgets its operand's concavity, because only its support point survives. Drag a Polygon along a ray instead and every notch of it is swept into the answer, which is then no more convex than the polygon was. Curved operands (Disk) are excluded beyond translation for the other reason: their support point is not on the lattice, so their sums are inexact rather than unrepresentable, and the two pairs that do have an answer carry a ResultNumber of their own instead of appearing here.
This concept is the only place that decides which pairs give back a single shape. The non-convex case is not a widening of it: a sum that can enclose a hole needs a PolygonWithHoles region result, so Polygon::minkowskiSum, PolygonWithHoles::minkowskiSum and Polyline::minkowskiSum carry it as an overload set of their own, over exactly the pairs this concept rejects. See implementation/minkowskisum.hpp.