Class DxfLine
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
A LINE of a DXF file, as AutoCAD's Line: the segment from StartPoint to EndPoint
in world coordinates, with the Normal its Thickness stands up along.
public sealed class DxfLine : DxfCurve
- Inheritance
-
DxfLine
- Inherited Members
Remarks
The line from (0, 0, 0) to (30, 40, 0) is Length 50, Delta (30, 40, 0) and Angle 0.927 radians. Its parameter is the distance from its start, as AutoCAD's is: it runs from 0 at StartPoint to 50 at EndPoint.
A point set is written in the groups 10, 20 and 30 (11, 21 and 31 for the end) as DxfWriter writes a
number, only the coordinates that change, and read back to the bit; every other group of the record is kept as it was.
new DxfLine(start, end) { Layer = "steel" } makes one in code, to be added to a drawing by
AppendEntity(DxfEntity).
Constructors
- DxfLine()
Initializes a line of no length at the origin, as AutoCAD's
new Line(), on layer 0 in no file; give it its ends before it is drawn.
- DxfLine(GeoPoint3, GeoPoint3)
Initializes a line from one point to another, as AutoCAD's
new Line(start, end), on layer 0 with no look of its own, in no file until it is added to one.
Properties
- Angle
Gets the angle of the line in the plane of its Normal, as AutoCAD's
Angle: in radians from the x axis of the normal's own system, counter-clockwise seen from its tip, from nought up to 2 pi; the line from (0, 0, 0) to (0, 10, 0) is pi / 2.
- Area
Gets nought: a line closes no area.
- Closed
Gets nought: a line is not closed.
- Delta
Gets the vector from the start of the line to its end, as AutoCAD's
Delta.
- EndPoint
Gets or sets where the line ends (groups 11, 21, 31), in world coordinates; the origin where the record gives none.
- Length
Gets the length of the line, as AutoCAD's
Length.
- Normal
Gets or sets the normal of the line (groups 210, 220, 230), the direction its Thickness stands up along, of unit length; (0, 0, 1) where the record gives none.
- StartPoint
Gets or sets where the line starts (groups 10, 20, 30), in world coordinates; the origin where the record gives none.
- Thickness
Gets or sets how far the line stands up along its Normal (group 39), a wall of that height; nought where the record gives none.
Methods
- Extend(bool, GeoPoint3)
Extends the line at one end to a point on the infinite line through it, as AutoCAD's
Extend.
- Extend(double)
Extends the line along itself to a parameter past one of its ends, as AutoCAD's
Extend: below nought moves its start back, above Length moves its end on.
- GetClosestPointTo(GeoPoint3, bool)
Gets the point of the line nearest a point, as AutoCAD's
GetClosestPointTo: on the segment, or on the infinite line through it where it is extended.
- GetDistAtPoint(GeoPoint3)
Gets the distance from the start of the line to a point of it.
- GetDistanceAtParameter(double)
Gets the distance at a parameter: the parameter itself, as on any AutoCAD line.
- GetFirstDerivative(double)
Gets the derivative of the line at a parameter, as AutoCAD's
GetFirstDerivative: the unit direction from its start to its end, the parameter being the distance; nought for a line of no length.
- GetOffsetCurves(double)
Gets the line at a distance from this one in the plane of its Normal, as AutoCAD's
GetOffsetCurves: to the left of its direction seen from the tip of the normal where the distance is above nought, to the right where below, as AutoCAD 2021 offsets a line: the line from (0, 0, 0) to (30, 40, 0) offset by 5 runs from (-4, 3, 0) to (26, 43, 0). A DxfPolyline and a DxfSpline go the other way, to the right, as AutoCAD offsets them, and an arc's radius grows.
- GetOffsetCurvesGivenPlaneNormal(GeoVector3, double)
Gets the line at a distance from this one in the plane of a normal, as AutoCAD's
GetOffsetCurvesGivenPlaneNormal: to the left of its direction seen from the tip of the normal where the distance is above nought, as GetOffsetCurves(double) says, so to the right about the normal turned over.
- GetParameterAtDistance(double)
Gets the parameter at a distance: the distance itself.
- GetParameterAtPoint(GeoPoint3)
Gets the parameter at a point of the line, the distance from its start, as AutoCAD's
GetParameterAtPoint.
- GetPointAtDist(double)
Gets the point at a distance from the start of the line.
- GetPointAtParameter(double)
Gets the point at a parameter, the distance from the start of the line, as AutoCAD's
GetPointAtParameter.
- GetSecondDerivative(double)
Gets the second derivative of the line: nought, as a line does not bend.
- GetSplitCurves(IReadOnlyList<double>)
Gets the pieces the line is cut into at parameters, as AutoCAD's
GetSplitCurves: lines of the same look in no file, from the start to the first parameter, on to the next, and to the end, the parameters taken in increasing order, those at an end or within the point tolerance of another cutting nothing.
- ReverseCurve()
Turns the line to run from its end to its start, as AutoCAD's
ReverseCurve.
- SetFromGeCurve(object)
Gives the line the ends of a GeoLine3, as AutoCAD's
SetFromGeCurve, its normal kept; or of a GeoLine2, written at z = 0 with the normal (0, 0, 1) as DxfWriter writes one, which ToGeoLine2() gives back to the bit.
- ToGeoLine2()
Gets the segment of the line in the plane, as DxfReader reads it with PlanAs2D within the default tolerance: the line from (0, 0, 0) to (100, 50, 0) is the GeoLine2 from (0, 0) to (100, 50). With a z of 5 at one end it does not lie on the floor, and is refused rather than flattened, where the AutoCAD bridge's
ToGeoLine2drops z.
- ToGeoLine2(Tolerance)
Gets the segment of the line in the plane, as DxfReader reads it with PlanAs2D within a tolerance, which says whether it has a length: a line 0.0004 long is refused within the default tolerance and given within 1E-5.
- ToGeoLine3()
Gets the segment of the line, as AutoCAD's
GetGeCurveand the AutoCAD bridge'sToGeoLine3give it: the shape GetGeometry() gives, to the bit. The line from (0, 0, 0) to (100, 50, 0) is the GeoLine3 between them.