Table of Contents

Method ToPolygon

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

ToPolygon()

Gets the polygon that closes this chain, joining its last vertex back to its first.

public GeoPolygon3 ToPolygon()

Returns

GeoPolygon3

Remarks

The polygon has the chain's vertices, however short a leg; a last vertex on the first, or off it by no more than the rounding of its coordinates, 1E-12 of the largest of them and of one at the least, is the chain written closed, and goes. At a millionth, the chain round the triangle (0, 0, 0), (10, 0, 0), (10, 0, 10) with every corner cut by 0.0003 is the polygon of its six corners, where it was put back together within the global tolerance of a thousandth and came back three. The chain round the square 10 across from (100, 100, 0) ending 1E-12 off its start is that square, and ending 0.0001 off, a polygon of five corners. The polygon is still checked flat and enclosing an area within the global tolerance.

Exceptions

ArgumentException

Thrown when the chain has fewer than three distinct vertices or is not planar, since a polygon requires both.

InvalidOperationException

Thrown when the chain has a coordinate that is not a finite number.