Table of Contents

Class DxfPolyline3d

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

A 3D POLYLINE of a DXF file (flag 8 of its group 70), as AutoCAD's Polyline3d: the POLYLINE record with its DxfPolylineVertex3d records and its SEQEND, straight segments from vertex to vertex in the world.

public sealed class DxfPolyline3d : DxfCurve, IEnumerable<DxfPolylineVertex3d>, IEnumerable
Inheritance
DxfPolyline3d
Implements
Inherited Members
Extension Methods

Remarks

The polyline is walked as AutoCAD walks one, foreach (DxfPolylineVertex3d vertex in polyline). The polyline (0, 0, 0), (3, 4, 0), (3, 4, 12) is Length 18; its parameter is AutoCAD's, the index of the vertex a segment leaves plus how far along it: 1.5 is (3, 4, 6).

new DxfPolyline3d(DxfPoly3dType.SimplePoly, points, false) makes one in code, to be added to a drawing of any version. A vertex set, added or taken out is that one record written, put in or taken out, every other vertex keeping its handle.

Constructors

DxfPolyline3d()

Initializes a 3D polyline of no vertices, as AutoCAD's new Polyline3d(), on layer 0 in no file.

DxfPolyline3d(DxfPoly3dType, IEnumerable<GeoPoint3>, bool)

Initializes a 3D polyline of vertices, as AutoCAD's new Polyline3d(type, vertices, closed), on layer 0 in no file until it is added to one.

Properties

Closed

Gets or sets whether a segment runs from the last vertex back to the first (flag 1 of group 70), as AutoCAD's Closed.

EndParam

Gets the parameter at the end of the polyline: the count of its segments, as AutoCAD's.

Length

Gets the length of the polyline, the sum of those of its segments, as AutoCAD's Length.

PolyType

Gets or sets how the polyline is drawn through its vertices, as AutoCAD's PolyType: as a spline (flag 4 of group 70, quadratic where group 75 is 5, cubic otherwise), or straight.

Methods

AppendVertex(DxfPolylineVertex3d)

Appends a vertex made in code after the last, as AutoCAD's AppendVertex: the vertex is that of the polyline from then on.

ConvertToPolyType(DxfPoly3dType)

Converts the polyline to a type, as AutoCAD's ConvertToPolyType: straightened for SimplePoly, fitted with a quadratic or cubic B-spline of the header's SPLINESEGS segments to a span (8 where the file gives none) as SplineFit(DxfPoly3dType, int) fits it.

Explode()

Gets the lines the polyline breaks into, as AutoCAD's Explode: a LINE for each segment between two vertices it is drawn through, in its order, the closing one of a closed polyline among them, each with its look; a segment of no length left out. The polyline through (0, 0, 0), (1, 2, 3) and (4, 5, 6) comes out as two lines.

Extend(bool, GeoPoint3)

Moves an end of the polyline to a point on the line through its end segment past that end, as AutoCAD's Extend; a point on the segment itself is refused.

Extend(double)

Runs an end segment of the polyline on to a parameter past an end, as AutoCAD's Extend: above EndParam the last segment on along itself, its end vertex moved to how far past it the parameter is along that segment; below nought the first back. The one vertex record is written, every handle kept.

GetClosestPointTo(GeoPoint3, bool)

Gets the point of the polyline nearest a point, as AutoCAD's GetClosestPointTo: the first segment's where two are as near.

GetDistAtPoint(GeoPoint3)

Gets the distance along the polyline from its start to a point of it, as AutoCAD's GetDistAtPoint.

GetDistanceAtParameter(double)

Gets the distance along the polyline from its start to a parameter, as AutoCAD's GetDistanceAtParameter.

GetEnumerator()

Gets an enumerator over the vertices in their order, as AutoCAD's GetEnumerator walks them: each the same object while its record is there.

GetFirstDerivative(double)

Gets the derivative of the point by the parameter, as AutoCAD's GetFirstDerivative: the vector from the start of the segment to its end.

GetOffsetCurves(double)

Gets the polylines at a distance from this one in the plane it lies in, as AutoCAD's GetOffsetCurves, as GetOffsetCurvesGivenPlaneNormal(GeoVector3, double) offsets it about the normal of that plane turned to the side its largest part is above nought on, (0, 0, 1) for a polyline on the floor: to the right of its way seen from above, so that a closed polyline running counter-clockwise grows. A closed one that crosses itself in its plane has none, as a DxfPolyline has none.

GetOffsetCurvesGivenPlaneNormal(GeoVector3, double)

Gets the polylines at a distance from this one in the plane of a normal, as AutoCAD's GetOffsetCurvesGivenPlaneNormal: the polyline taken into the plane square to the normal it lies in, offset there as a DxfPolyline offsets its own, to the right of its way seen from the tip of the normal where the distance is above nought, and taken back; an arc a corner comes round by is given as the chords that keep within the point tolerance of it, a 3D polyline having none.

GetParameterAtDistance(double)

Gets the parameter at a distance along the polyline from its start, as AutoCAD's GetParameterAtDistance.

GetParameterAtPoint(GeoPoint3)

Gets the parameter at a point of the polyline, as AutoCAD's GetParameterAtPoint.

GetPointAtDist(double)

Gets the point at a distance along the polyline from its start, as AutoCAD's GetPointAtDist.

GetPointAtParameter(double)

Gets the point at a parameter, the index of a vertex plus how far along the segment it leaves, as AutoCAD's GetPointAtParameter.

GetSecondDerivative(double)

Gets the second derivative of the point by the parameter, as AutoCAD's GetSecondDerivative: nought, the segments being straight.

GetSplitCurves(IReadOnlyList<double>)

Gets the pieces the polyline is cut into at parameters, as AutoCAD's GetSplitCurves: 3D polylines of the same look in no file, an open one from its start to the first parameter, on to the next and to its end, a closed one from each to the next and from the last on round its first vertex to the first, given whole where it is cut at fewer than two places; (0, 0, 0), (3, 4, 0), (3, 4, 12) cut at 1.5 is (0, 0, 0), (3, 4, 0), (3, 4, 6) and (3, 4, 6), (3, 4, 12). A parameter at an end or within the point tolerance along the polyline of another cuts nothing; a fitted polyline is cut along the vertices it is drawn through, and its pieces are straight.

InsertVertexAt(DxfPolylineVertex3d, DxfPolylineVertex3d)

Puts a vertex made in code after a vertex of the polyline, as AutoCAD's InsertVertexAt; before the first where the vertex given is null.

ReverseCurve()

Turns the polyline to run from its end to its start, as AutoCAD's ReverseCurve: the vertices in the other order, a closed polyline keeping its first vertex. Each vertex record takes the point and flags of its counterpart in one writing of the polyline, every handle kept.

SetFromGeCurve(object)

Gives the polyline the vertices of a chain or loop, as AutoCAD's SetFromGeCurve, written as DxfWriter writes one as a 3D POLYLINE, its VERTEX records written anew and its SEQEND kept: a GeoPolyline3 open and a GeoPolygon3 closed, in world coordinates; a GeoPolyline2 or a GeoPolygon2 at z = 0, read back by ToGeoPolyline2() or ToGeoPolygon2() to the bit. Its handle, layer, look and extended data are kept. Where the shape is written anew its fitting is not kept, the polyline coming back straight; a shape written as the shape it has now is written leaves it as it is, widths and fitting and all.

SplineFit()

Fits the polyline with a spline, as AutoCAD's SplineFit: of the header's SPLINETYPE (5 quadratic, 6 cubic, cubic where the file gives none) and SPLINESEGS (8 where it gives none), as SplineFit(DxfPoly3dType, int) fits it.

SplineFit(DxfPoly3dType, int)

Fits the polyline with a spline, as AutoCAD's SplineFit: its vertices made the frame of a uniform B-spline in space (flag 16 of their group 70, each keeping its handle), clamped to the first and last vertex of an open polyline and running round a closed one, and the vertices of the curve added after the first of them (flag 8), where AutoCAD keeps them, as many segments to each span of the spline as asked (their count is taken where it is below nought, a 3D polyline having no arcs); flag 4 of the polyline's group 70 and group 75, 5 or 6. A fitted polyline is straightened first.

Straighten()

Straightens a polyline fitted with a spline, as AutoCAD's Straighten: the vertices the fitting made (flag 8) are taken out, those of the frame (16) are vertices of the polyline again, and flag 4 of group 70 and its group 75 go. A polyline that is not fitted is left as it is.

ToGeoPolygon2()

Gets the polyline as a loop of the plane, as ToGeoPolygon3() reads it, where it lies on the floor as ToGeoPolyline2() says.

ToGeoPolygon2(Tolerance)

Gets the polyline as a loop of the plane, as ToGeoPolygon2() does, within a tolerance, which says which vertices are one and whether it encloses an area.

ToGeoPolygon3()

Gets the polyline as a loop in the world, of the vertices ToGeoPolyline3() reads: closed or not, its last vertex joined back to its first, and a last vertex on the first left out. The closed polyline (0, 0, 0), (10, 0, 0), (10, 10, 5) is the GeoPolygon3 of those three corners, as GetGeometry() gives it. One whose vertices do not lie in one plane within the planar tolerance, or are on one line, is refused.

ToGeoPolyline2()

Gets the polyline as a chain of the plane, as ToGeoPolyline3() reads it, where it lies on the floor as DxfReader reads one with PlanAs2D: every vertex at a height of nought. The polyline (0, 0, 0), (3, 4, 0) is the GeoPolyline2 (0, 0), (3, 4); with (3, 4, 12) after them it is refused rather than flattened.

ToGeoPolyline2(Tolerance)

Gets the polyline as a chain of the plane, as ToGeoPolyline2() does, within a tolerance, which says which vertices are one.

ToGeoPolyline3()

Gets the polyline as a chain in the world, of its vertices as DxfReader reads them: the polyline (0, 0, 0), (3, 4, 0), (3, 4, 12) is that GeoPolyline3; closed, the chain runs on back to its first vertex. One fitted with a spline is read through the vertices of the spline drawn (flag 8), its frame (flag 16) left out. A vertex within the point tolerance of the one before it is left out.