Class DxfRay
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
A RAY of a DXF file, as AutoCAD's Ray: the half line from BasePoint without end along
UnitDir, in world coordinates.
public sealed class DxfRay : DxfCurve
- Inheritance
-
DxfRay
- Inherited Members
Remarks
The ray from (1, 1, 0) along (0.7071, 0.7071, 0) runs through (2, 2, 0) and on. Its parameter is the distance from its base point, as AutoCAD's is: it runs from nought at BasePoint up without end, so EndParam is infinite and it has no end point.
The file holds the base point (groups 10, 20, 30) and the direction (groups 11, 21, 31), as AutoCAD gives them; a
direction set is written made of unit length, and every other group of the record is kept as it was. A file of R12
has no rays: one made in code, new DxfRay { BasePoint = p, UnitDir = d }, is added to a drawing of R13 or later.
Constructors
- DxfRay()
Initializes a ray from the origin along the x axis, as AutoCAD's
new Ray(), on layer 0 in no file; give it its base point and direction before it is drawn.
Properties
- Area
Gets nought: a ray closes no area.
- BasePoint
Gets or sets the point the ray starts from (groups 10, 20, 30), in world coordinates, as AutoCAD's
BasePoint; the origin where the record gives none.
- Closed
Gets false: a ray is not closed.
- EndParam
Gets the parameter at the end of the ray: infinite, as it runs without end.
- EndPoint
Refuses: a ray runs without end, and has no end point, as AutoCAD's has none.
- SecondPoint
Gets or sets a second point of the ray, as AutoCAD's
SecondPoint: the base point and the direction; set, the direction is made the way from the base point to it.
- StartPoint
Gets or sets the point the ray starts from: its BasePoint.
- UnitDir
Gets or sets the direction of the ray (groups 11, 21, 31), as AutoCAD's
UnitDir: as the file holds it, of unit length in a file AutoCAD wrote; (0, 0, 1) where the record gives none.
Methods
- Extend(bool, GeoPoint3)
Extends the ray back to a point on the line through it, as AutoCAD's
Extend: the base point moved there.
- Extend(double)
Extends the ray back along itself to a parameter below nought, as AutoCAD's
Extend: its base point is moved back there, so that its parameters start anew from it.
- GetClosestPointTo(GeoPoint3, bool)
Gets the point of the ray nearest a point, as AutoCAD's
GetClosestPointTo: on the ray, or on the infinite line through it where it is extended.
- GetDistAtPoint(GeoPoint3)
Gets the distance from the base point to a point of the ray.
- GetDistanceAtParameter(double)
Gets the distance from the base point at a parameter: the parameter itself.
- GetFirstDerivative(double)
Gets the derivative of the ray at a parameter, as AutoCAD's
GetFirstDerivative: its direction made of unit length.
- GetOffsetCurves(double)
Refuses: a ray has no plane of its own to be offset in; GetOffsetCurvesGivenPlaneNormal(GeoVector3, double) takes one.
- GetOffsetCurvesGivenPlaneNormal(GeoVector3, double)
Gets the ray 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 a DxfLine is offset, AutoCAD 2021's side for a line.
- GetParameterAtDistance(double)
Gets the parameter at a distance from the base point: the distance itself.
- GetParameterAtPoint(GeoPoint3)
Gets the parameter at a point of the ray, the distance from the base point, as AutoCAD's
GetParameterAtPoint.
- GetPointAtDist(double)
Gets the point at a distance from the base point.
- GetPointAtParameter(double)
Gets the point at a parameter, the distance from the base point, as AutoCAD's
GetPointAtParameter.
- GetSecondDerivative(double)
Gets the second derivative of the ray: nought, as a ray does not bend.
- GetSplitCurves(IReadOnlyList<double>)
Gets the pieces the ray is cut into at parameters, as AutoCAD's
GetSplitCurves: lines from the base point to the first parameter and on to the next, then a ray from the last, all of the same look in no file; the parameters taken in increasing order, one at the base point or within the point tolerance of another cutting nothing.
- ReverseCurve()
Refuses, as AutoCAD does: a ray runs one way from its base point, and turned it would be another ray.
- SetFromGeCurve(object)
Gives the ray the origin and direction of a GeoRay3, as AutoCAD's
SetFromGeCurve, or of a GeoRay2 at z = 0, each written as DxfWriter writes one.
- ToGeoRay2()
Gets the ray in the plane, as DxfReader reads it with PlanAs2D within the default tolerance: the ray from (0, 0, 0) along (3, 4, 0) is the GeoRay2 from (0, 0) along (0.6, 0.8). One whose origin is at a height, or whose direction rises, does not lie on the floor, and is refused.
- ToGeoRay2(Tolerance)
Gets the ray in the plane, as ToGeoRay2() does, within a tolerance, which says whether it has a direction.
- ToGeoRay3()
Gets the ray as the library's, as AutoCAD's
GetGeCurveand the AutoCAD bridge'sToGeoRay3give it: the shape GetGeometry() gives, to the bit. The ray from (0, 0, 0) along (3, 4, 0) is the GeoRay3 from there along (0.6, 0.8, 0).