Method IsSimple
- Namespace
- GeometryHelper.Core
- Assembly
- GeometryHelper.dll
IsSimple(GeoPolygon3)
Checks whether a polygon is simple, using the default tolerance: no edge crosses or touches another except where neighbours share their vertex.
public static bool IsSimple(GeoPolygon3 polygon)
Parameters
polygonGeoPolygon3
Returns
IsSimple(GeoPolygon3, Tolerance)
Checks whether a polygon is simple, within a tolerance: no edge crosses or touches another except where neighbours share their vertex.
public static bool IsSimple(GeoPolygon3 polygon, Tolerance tolerance)
Parameters
polygonGeoPolygon3The polygon.
toleranceToleranceThe tolerance: edges closer than the point tolerance count as touching.
Returns
- bool
true if the polygon is simple; otherwise, false.
Remarks
GeoPolygon3 checks that it is flat but not that it is simple, because the check costs more than building it. A vertex touching another edge counts as not simple, and so does an edge folding back over its neighbour. Edges are swept in order along X, so the cost grows with the number of edges whose extents overlap rather than with the square of the edge count.
Exceptions
- ArgumentNullException
Thrown when the polygon is null.