MathHelperEntitiesToPolygon Method
|
Converts a list of entities that form a closed contour into an ordered polygon of 2D points.
Namespace:
DXFReaderNET
Assembly:
DXFReaderNET (in DXFReaderNET.dll) Version: 20.12.2
Syntaxpublic static List<Vector2> EntitiesToPolygon(
List<EntityObject> Entities,
int Precision = 100
)
Public Shared Function EntitiesToPolygon (
Entities As List(Of EntityObject),
Optional Precision As Integer = 100
) As List(Of Vector2)
public:
static List<Vector2>^ EntitiesToPolygon(
List<EntityObject^>^ Entities,
int Precision = 100
)
static member EntitiesToPolygon :
Entities : List<EntityObject> *
?Precision : int
(* Defaults:
let _Precision = defaultArg Precision 100
*)
-> List<Vector2>
STATIC METHOD EntitiesToPolygon(
Entities AS List<EntityObject>,
Precision AS LONG := 100
) AS List<Vector2>
Parameters
- Entities
- Type: System.Collections.GenericListEntityObject
The entities that make up the contour (typically lines, arcs, circles, ellipses, polylines, or splines).
The list does not need to be pre-sorted along the boundary.
- Precision (Optional)
- Type: SystemInt32
Number of divisions used to tessellate curved entities (arcs, circles, ellipses, splines).
Higher values produce a denser polygon. Default is 100.
Return Value
Type:
ListVector2
An ordered list of
Vector2 vertices that approximate the contour as a polygon.
Returns an empty list if
Entities is null or empty.
When several chain orderings are possible, the polygon with the largest absolute area is returned.
Remarks
Curved entities are sampled according to Precision.
Endpoint matching uses the drawing linear unit precision (LUprec) when available.
See Also