Constructor GeoPolygon3
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
GeoPolygon3(IEnumerable<GeoPoint3>)
Initializes a new polygon from a sequence of coplanar vertices.
public GeoPolygon3(IEnumerable<GeoPoint3> vertices)
Parameters
verticesIEnumerable<GeoPoint3>The vertices, in order around the loop.
Remarks
Consecutive duplicates within tolerance are dropped and a repeated closing vertex is removed, so the loop closes implicitly and no zero-length edge survives. The normal and area are measured once here rather than on every read: the polygon cannot change afterwards, and the Newell sum they both come from is a full pass over the vertices.
Collinear means an area within the vector tolerance and no width: twice the area over the span, the longest side of three corners or the diagonal of the box of more, within the point tolerance. A square 0.002 by 0.002, of 4E-6 square units, is a polygon at the default tolerance, where it was refused; a triangle 0.003 long and 0.0006 high is still refused, and one 100 long and 0.0005 high, of 0.025 square units, still kept.
Exceptions
- ArgumentNullException
Thrown when the sequence is null.
- ArgumentException
Thrown when fewer than three distinct vertices remain, when they are collinear, or when they do not lie on a common plane.
GeoPolygon3(IEnumerable<GeoPoint3>, Tolerance)
Initializes a new polygon from a sequence of coplanar vertices, within a tolerance.
public GeoPolygon3(IEnumerable<GeoPoint3> vertices, Tolerance tolerance)
Parameters
verticesIEnumerable<GeoPoint3>The vertices, in order around the loop.
toleranceToleranceThe tolerance deciding duplicate vertices and flatness.
GeoPolygon3(params GeoPoint3[])
Initializes a new polygon directly from vertex arguments.
public GeoPolygon3(params GeoPoint3[] vertices)
Parameters
verticesGeoPoint3[]