Table of Contents

Method ToGeoPolygon2

Namespace
GeometryHelper.CadConvert
Assembly
GeometryHelper.CadConvert.dll

ToGeoPolygon2(Polyline)

Converts a AutoCAD Polyline to a GeometryHelper 2D polygon, cutting any arcs into straight pieces.

public static GeoPolygon2 ToGeoPolygon2(this Polyline polyline)

Parameters

polyline Polyline

The AutoCAD Polyline to convert.

Returns

GeoPolygon2

The converted GeoPolygon2.

Remarks

The arcs are cut as ToGeoPolyline2(Polyline) cuts them. Their chords lie inside them, so a shape bulging outward encloses a little less than the drawing does and one bulging inward a little more.

Exceptions

ArgumentNullException

Thrown when polyline is null.

ToGeoPolygon2(Polyline, double)

Converts a AutoCAD Polyline to a GeometryHelper 2D polygon, cutting any arcs into straight pieces no further than a chord tolerance from the curve.

public static GeoPolygon2 ToGeoPolygon2(this Polyline polyline, double chordTolerance)

Parameters

polyline Polyline

The AutoCAD Polyline to convert.

chordTolerance double

The largest gap allowed between a piece and the arc it replaces, in drawing units. Zero picks the automatic share of each radius.

Returns

GeoPolygon2

The converted GeoPolygon2.

Exceptions

ArgumentNullException

Thrown when polyline is null.

ArgumentOutOfRangeException

Thrown when the tolerance is negative or not a number.

ToGeoPolygon2(IEnumerable<Polyline>)

Converts a sequence of AutoCAD Polylines to a list of GeometryHelper 2D polygons.

public static List<GeoPolygon2> ToGeoPolygon2(this IEnumerable<Polyline> polylines)

Parameters

polylines IEnumerable<Polyline>

The sequence of AutoCAD Polylines to convert.

Returns

List<GeoPolygon2>

A list of converted GeoPolygon2.