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
polylinePolylineThe 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
polylineis 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
polylinePolylineThe AutoCAD Polyline to convert.
chordTolerancedoubleThe 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
polylineis 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
polylinesIEnumerable<Polyline>The sequence of AutoCAD Polylines to convert.
Returns
- List<GeoPolygon2>
A list of converted GeoPolygon2.