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

Bounded polygonal regions: exactly the shapes a PolygonSet can always represent. More...

#include <forward.hpp>

Concept definition

template<class T>
Definition forward.hpp:315
Definition forward.hpp:316
Definition forward.hpp:318
Definition forward.hpp:317
Bounded polygonal regions: exactly the shapes a PolygonSet can always represent.
Definition forward.hpp:403
Definition forward.hpp:313
Definition forward.hpp:314

Detailed Description

Bounded polygonal regions: exactly the shapes a PolygonSet can always represent.

Each of these is a closed bounded subset of the plane whose boundary is a finite set of straight edges, so it is a set of regions — one component for a Rectangle, a Triangle, a Convex, a Polygon or a PolygonWithHoles, and however many the set already carries for a PolygonSet. That makes them closed under union: A ∪ B is again a bounded polygonal region whenever both operands are, which is what lets regularizedUnion be defined for every ordered pair of them and for no other pair.

What is left out is left out for one of three reasons. A Point, a Segment, a Polyline and a MonotoneChain carry no area, so a union with one keeps a dangling piece no set of regions can hold. A Halfplane, a Line, a Ray and a HalfplaneIntersection may be unbounded (the last only sometimes, which is already too often for always). A Disk is bounded and has area, but its boundary is round. EmptyShape is a region — the empty one — but it is the identity of every union, and the library keeps it out of the region vocabulary so that its operations stay the uniform vacuous ones.

A degenerate operand is admitted and contributes nothing: a rectangle with no width covers no area, and a regularized union drops what has none.