PolyShell's Axioms
PolyShell promises to provide reliable high-performance polygon reduction algorithms which behave in a predictable way. PolyShell's axioms consist of both the assumptions we make about a user's input and, given these are upheld, the assumptions the user can make about the output they receive.
Warning
PolyShell provides little-to-no input validation. While memory-safety is always guaranteed, if the following assumptions are broken you may receive an error or an invalid reduction. If you are uncertain whether your data upholds these requirements, we encourage you to use Shapely to perform your own validation first.
Polygon Validity
All input to PolyShell is expected to be valid.
Definition
A polygon is said to be valid if:
- It is a simple polygon.
- The vertices are stored as a sequence in clockwise order.
- The first and last coordinate in the sequence are equal.
Our Promise
Provided the assumptions made above are upheld, PolyShell makes the following promises:
- The reduced polygon will always be valid.
- The reduced polygon will always contain the input polygon in its interior.
- Vertices are never moved nor added.
- Reduction preserves the ordering of the vertices, but is not necessarily stable.
Note
While the sequence of vertices within the polygon is preserved, the location of the first vertex may shift depending on the algorithm used.