Pangolin
Header-only C++20 plane computational geometry library
Loading...
Searching...
No Matches
pgl::MinkowskiSummableConcept Concept Reference

Shape pairs whose Minkowski sum Pangolin can represent. More...

#include <forward.hpp>

Concept definition

template<class A, class B>
(ShapeConcept<A> || detail::shapeRank<std::remove_cvref_t<A>> >= 0) &&
(ShapeConcept<B> || detail::shapeRank<std::remove_cvref_t<B>> >= 0) &&
Bounded convex primitives.
Definition forward.hpp:339
Bounded polygonal primitives, convex or not.
Definition forward.hpp:373
Definition forward.hpp:305
Definition forward.hpp:312
Shape pairs whose Minkowski sum Pangolin can represent.
Definition forward.hpp:476
Definition forward.hpp:306
Definition forward.hpp:323
Unbounded convex polyhedral primitives.
Definition forward.hpp:358

Detailed Description

Shape pairs whose Minkowski sum Pangolin can represent.

The sum A ⊕ B is supported when

  • either operand is the empty shape (which absorbs), or
  • either operand is a Point, so the sum is a translation of the other and every shape kind is closed under it, or
  • both operands are bounded convex (BoundedConvexConcept), or
  • one is a Halfplane and the other is bounded polygonal (BoundedPolygonalConcept), convex or not: a half-plane absorbs everything bounded and comes back a half-plane, translated to its operand's support point, or
  • one is unbounded convex (UnboundedConvexConcept) and the other is unbounded convex or bounded convex: two convex polyhedra sum to a convex polyhedron, returned as a HalfplaneIntersection.

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.