Class Polygon
Polygon class type for handling polygons made up of 2 or more points, a property defines in polygon is closed or open
Implements
Inherited Members
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public class Polygon : Collection<IPolygonSegment>, IList<IPolygonSegment>, ICollection<IPolygonSegment>, IReadOnlyList<IPolygonSegment>, IReadOnlyCollection<IPolygonSegment>, IEnumerable<IPolygonSegment>, IList, ICollection, IEnumerable
  Constructors
View SourcePolygon()
Construct
Declaration
public Polygon()
  Remarks
Polygon will be open, first and last points not connected
Polygon(Point3d[], bool)
Construct a polygon from an array of Point3d[]'s
Declaration
public Polygon(Point3d[] points, bool closed = true)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Point3d[] | points | Array of Poind3d  | 
      
| bool | closed | Is a closed polygon  | 
      
Polygon(bool)
Construct with a bool declared if polygon will be closed or not
Declaration
public Polygon(bool closed)
  Parameters
| Type | Name | Description | 
|---|---|---|
| bool | closed | 
Methods
View SourceAddArc(Point3d, Point3d, PolygonArcSegmentDirections)
Add a Arc segment to the polygon using the parameters passed
Declaration
public void AddArc(Point3d centre, Point3d start, PolygonArcSegmentDirections polygonArcSegmentDirection = PolygonArcSegmentDirections.CounterClockwise)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Point3d | centre | Centre point of arc  | 
      
| Point3d | start | Start point on circumference of arc  | 
      
| PolygonArcSegmentDirections | polygonArcSegmentDirection | Direction in which the draw the arc, default: CCW  | 
      
AddLine(Point3d)
Add a Line segment to the polygon using the coordinates in the parameter
Declaration
public void AddLine(Point3d start)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Point3d | start | Projection or Zone name of the cartesian grid coordinates  | 
      
AsGeoMapElementCollection(string)
Transforms polygon into a collection of GeoMapElements
Declaration
public GeoMapElementCollection AsGeoMapElementCollection(string projectionOfCartesianCoordinates)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | projectionOfCartesianCoordinates | Projection or Zone name of the cartesian grid coordinates  | 
      
Returns
| Type | Description | 
|---|---|
| GeoMapElementCollection | 
Exceptions
| Type | Condition | 
|---|---|
| Exception | Unknown polygon segment type  | 
      
ConstructPolygonBoundary(List<Point3d>, List<Circle>)
Constructs a boundary polygon that fits to the extents of the point geometry. The resulted polygon will be convex and enclose all given points and circles.
Declaration
public static Polygon ConstructPolygonBoundary(List<Point3d> points, List<Circle> circles)
  Parameters
| Type | Name | Description | 
|---|---|---|
| List<Point3d> | points | Discrete vertices, must be 2D  | 
      
| List<Circle> | circles | discrete circles, must be 2D  | 
      
Returns
| Type | Description | 
|---|---|
| Polygon | 
Exceptions
| Type | Condition | 
|---|---|
| Exception | Invalid input in ConstructPolygonBoundary()  |