Class Polygon
A closed planar PolyLine.
public class Polygon : PolyLine, IGeometry<NurbsBase>, IEquatable<NurbsBase>, ITransformable<NurbsBase>, IGeometry<PolyLine>, IEquatable<PolyLine>, ITransformable<PolyLine>
public Polygon(IList<Point3> vertices)
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Point3> | vertices |
Gets the area from a list of points.
The list should represent a closed curve and planar.
https://stackoverflow.com/questions/25340106/boostgeometry-find-area-of-2d-polygon-in-3d-space
http://geomalgorithms.com/a01-_area.html
public double Area { get; }
Type | Description |
---|---|
System.Double | Area calculated. |
Gets the centroid of mass of the polygon.
https://stackoverflow.com/questions/9815699/how-to-calculate-centroid
http://csharphelper.com/blog/2014/07/find-the-centroid-of-a-polygon-in-c/
public Point3 CentroidByArea { get; }
Type | Description |
---|---|
Point3 |
Gets the centroid averaging the vertices.
public Point3 CentroidByVertices { get; }
Type | Description |
---|---|
Point3 |
Gets the plane of the Polygon.
public Plane Plane { get; }
Type | Description |
---|---|
Plane |
Creates a rectangle on a plane.
The plane is located at the centre of the rectangle.
public static Polygon Rectangle(Plane plane, double xDimension, double yDimension)
Type | Name | Description |
---|---|---|
Plane | plane | The plane on where the rectangle will be created. |
System.Double | xDimension | The value dimension of the rectangle along the x direction of the plane. |
System.Double | yDimension | The value dimension of the rectangle along the y direction of the plane. |
Type | Description |
---|---|
Polygon |
Creates a regular polygon, inscribed into a circle.
The plane is located at the centre of the polygon.
public static Polygon RegularPolygon(Plane plane, double radius, int numberOfSegments)
Type | Name | Description |
---|---|---|
Plane | plane | The plane on where the polygon will be created. |
System.Double | radius | The distance from the center to the corners of the polygon. |
System.Int32 | numberOfSegments | Number of segments of the polygon. |
Type | Description |
---|---|
Polygon |
Applies a transformation to all the points.
public Polygon Transform(TransformMatrix transform)
Type | Name | Description |
---|---|---|
TransformMatrix | transform | Transformation matrix to apply. |
Type | Description |
---|---|
Polygon | A polygon transformed. |