coerceIn
Polygon coerceIn Polygon => Polygon
Returns this polygon nudged back inside boundary's solid region, or this untouched when it already lies inside, boundary included.
The penetration found by escape is resolved by the minimal position fix subject * T(normal * depth): a translation along the penetration's correcting normal by its raw depth. Which region "inside" names is the operand's own claim: a classic boundary keeps the subject in its bounded interior, retreated back from its deepest protrusion; an inside-out one keeps it in the closed complement of its loop, pushed out of the loop along the shallowest push-out. One penetration is resolved per call — a subject violating several of boundary's faces at once converges by coercing again. The query contract is escape's: sound for a convex loop on boundary only (against a classic boundary the subject may be any polygon; against an inside-out one it must be convex too), with existence rounded at the SCALE quantum — a subject exactly on the solid region's boundary is already valid. The nudged result is the receiver's own class — the translation returns through Polygon.copy — and a valid subject returns this itself. coerceOut is the dual constraint, related through negation: subject coerceIn -polygon and subject coerceOut polygon land the subject identically. A resolution other than the nudge is spelled on the query itself: (subject escape boundary) { … }.
Receiver
The subject polygon to keep inside boundary's solid region.
Return
The nudged polygon as the receiver's class, or this untouched when the subject already lies inside.
Parameters
The polygon whose oriented solid region the subject may not leave.
Type Parameters
The receiver's type, preserved in the result.
Throws
when the nudge lands two consecutive vertices rounded-coincident at the SCALE quantum.