Polygon2d
A polygon internally represented by an array of points. Implemented as a structure, the validity of the polygon can be checked via its PointCount, which must be bigger than 0 for a polygon to hold any points, and bigger than 2 for a polygon to be geometrically valid.
Constructors
Constructor | Description |
new(pointArray, pointCount)
Signature: (pointArray:V2d [] * pointCount:int) -> unit
|
Creates a polygon from given points. |
new(pointArray)
Signature: (pointArray:V2d []) -> unit
|
Creates a polygon from given points. |
new(pointArray, startIndex, count)
Signature: (pointArray:V2d [] * startIndex:int * count:int) -> unit
|
Creates a polygon from given points. |
new(pointCount, index_pointCreator)
Signature: (pointCount:int * index_pointCreator:Func<int,V2d>) -> unit
|
Creates a polygon from point count and point creator function. |
new(points)
Signature: points:IEnumerable<V2d> -> unit
|
Creates a polygon from a sequence of points. |
new(indexArray, pointArray)
Signature: (indexArray:int [] * pointArray:V2d []) -> unit
|
Creates a polygon from the points of a pointArray that are selected by an index array. |
new(triangle)
Signature: triangle:Triangle2d -> unit
|
Creates a polygon from a triangle. |
new(quad)
Signature: quad:Quad2d -> unit
|
Creates a polygon from a quad. |
new(original)
Signature: original:Polygon2d -> unit
|
Copy constructor. Performs deep copy of original. |
Instance members
Instance member | Description |
BoundingBox2d
Signature: Box2d
Modifiers: abstract |
Bounding box of polygon. |
Copy()
Signature: unit -> Polygon2d
|
Returns copy of polygon. Same as Map(p => p). |
Copy(point_fun)
Signature: point_fun:Func<V2d,V2d> -> Polygon2d
|
Obsolete. Use 'Map' instead (same functionality and parameters). |
Edge(index)
Signature: index:int -> V2d
|
Index-th edge as vector (edgeEndPos - edgeBeginPos). |
EdgeLine(index)
Signature: index:int -> Line2d
|
Index-th edge as line segment (edgeBeginPos, edgeEndPos). |
EdgeLines
Signature: IEnumerable<Line2d>
|
Edges as line segments (edgeBeginPos, edgeEndPos). |
Edges
Signature: IEnumerable<V2d>
|
Edges as vectors (edgeEndPos - edgeBeginPos). |
Equals(other)
Signature: other:obj -> bool
Modifiers: abstract |
|
GetEdgeArray()
Signature: unit -> V2d []
|
Edges as vectors (edgeEndPos - edgeBeginPos). |
GetEdgeLineArray()
Signature: unit -> Line2d []
|
Edges as line segments (edgeBeginPos, edgeEndPos). |
GetHashCode()
Signature: unit -> int
Modifiers: abstract |
|
GetPointArray()
Signature: unit -> V2d []
|
Returns a copy of the polygons point array. |
GetPointArray(point_copyFun)
Signature: point_copyFun:Func<V2d,'T> -> 'T []
Type parameters: 'T |
Returns a transformed copy of the polygons point array. |
GetPointArray(point_index_copyFun)
Signature: point_index_copyFun:Func<V2d,int,'T> -> 'T []
Type parameters: 'T |
Returns a transformed copy of the polygons point array. |
GetPointArrayWithRepeatedFirstPoint()
Signature: unit -> V2d []
|
[P0, P1, P2] -> [P0, P1, P2, P0]. |
IsInvalid
Signature: bool
Modifiers: abstract |
|
IsValid
Signature: bool
Modifiers: abstract |
|
[()]
Signature: unit -> int
Modifiers: abstract |
Gets the index-th point of this polygon. |
Map(point_fun)
Signature: point_fun:Func<V2d,V2d> -> Polygon2d
|
Returns transformed copy of this polygon. |
PointCount
Signature: int
Modifiers: abstract |
The number of points in the polygon. If this is 0, the polygon is invalid. |
Points
Signature: IEnumerable<V2d>
|
Enumerates points. |
Reverse()
Signature: unit -> unit
|
Reverses order of vertices in-place. |
Reversed
Signature: Polygon2d
|
Gets copy with reversed order of vertices. |
Revert()
Signature: unit -> unit
|
Obsolete. Use 'Reverse' instead.. |
ToString()
Signature: unit -> string
Modifiers: abstract |
Static members
Static member | Description |
Parse(s)
Signature: s:string -> Polygon2d
|