Method TryUninvert
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
TryUninvert(IReadOnlyList<GeoPoint2>, out IReadOnlyList<GeoPoint2>)
Takes a boundary that Inverted(IReadOnlyList<GeoPoint2>, GeoPoint2, GeoPoint2) made, or AutoCAD wrote for a clip turned inside out, back to its polygon: the seven points of the slit and the box round it left out. The slit is found wherever the ring starts: a point and the point a slit's width from it, a run of the four corners of an axis-aligned box between the slit's two passes, the passes ending on one side of the box and running square to it. A polygon of the clip, not a keyhole, is not one.
public static bool TryUninvert(IReadOnlyList<GeoPoint2> boundary, out IReadOnlyList<GeoPoint2> polygon)
Parameters
boundaryIReadOnlyList<GeoPoint2>The points of the boundary, in the clip coordinate system.
polygonIReadOnlyList<GeoPoint2>The polygon, in the order Inverted(IReadOnlyList<GeoPoint2>, GeoPoint2, GeoPoint2) was given it where the slit lies within the ring, else from the point after the slit; empty where the boundary is not a keyhole.
Returns
- bool
true where the boundary is a keyhole.
Exceptions
- ArgumentNullException
Thrown when the boundary is null.