Table of Contents

Method ToPolygon

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

ToPolygon()

Converts this polyline into a solid 2D GeoPolygon2. The chain is closed by connecting the last vertex back to the first.

public GeoPolygon2 ToPolygon()

Returns

GeoPolygon2

A new GeoPolygon2 instance.

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), (10, 0), (10, 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) ending 1E-12 off its start is that square, and ending 0.0001 off, a polygon of five corners.