Click or drag to resize

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
Syntax
public static List<Vector2> EntitiesToPolygon(
	List<EntityObject> Entities,
	int Precision = 100
)

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