Class DxfEllipse
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
An ELLIPSE of a DXF file, as AutoCAD's Ellipse: about Center, its MajorAxis from
the centre to the end of its long axis, its MinorAxis the Normal crossed with that and
RadiusRatio times as long, running counter-clockwise about the normal from its start to its end.
public sealed class DxfEllipse : DxfCurve
- Inheritance
-
DxfEllipse
- Inherited Members
Remarks
The ellipse about (0, 0, 0) with the major axis (10, 0, 0) and the ratio 0.5 is MajorRadius 10, MinorRadius 5 and Area 157.08, and runs through (0, 5, 0). Everything of it is in world coordinates, as the file holds it.
Its parameter is the eccentric angle, as AutoCAD's is, which the file holds (groups 41 and 42): the point at the parameter t is the centre, the major axis times cos t and the minor axis times sin t. The angles AutoCAD calls StartAngle and EndAngle are another thing, those of the lines from the centre to the ends, from the major axis: on that ellipse the parameter pi / 4 is the point (7.071, 3.536, 0), at the angle 0.4636. A whole ellipse runs from 0 to 2 pi. Every other group of the record is kept as it was.
Constructors
- DxfEllipse()
Initializes the whole ellipse about the origin on the normal (0, 0, 1) with the major axis (1, 0, 0) and the ratio 1, as AutoCAD's
new Ellipse(), on layer 0 in no file.
- DxfEllipse(GeoPoint3, GeoVector3, GeoVector3, double, double, double)
Initializes an ellipse, as AutoCAD's
new Ellipse(center, unitNormal, majorAxis, radiusRatio, startAngle, endAngle), on layer 0 with no look of its own, in no file until it is added to one: nought and 2 pi make it whole.
Properties
- Area
Gets the area the ellipse closes, as AutoCAD's
Area: pi times its two radii for a whole one, and for a part the area between it and the chord from its start to its end.
- Center
Gets or sets the centre of the ellipse (groups 10, 20, 30), in world coordinates, as AutoCAD's
Center; the origin where the record gives none.
- Closed
Gets whether the ellipse is whole: its parameters a whole turn apart, or the same, as the reader takes them.
- EndAngle
Gets or sets the angle of the end of the ellipse, as AutoCAD's
EndAngle: of the line from the centre to it, in radians from the major axis; 2 pi for a whole ellipse that ends where the file's parameter is 2 pi.
- EndParam
Gets or sets the parameter at the end of the ellipse (group 42), as AutoCAD's
EndParam: an eccentric angle in radians, 2 pi where the record gives none, and 2 pi more where the file's is not above the start, so that it runs from StartParam up.
- IsNull
Gets whether the ellipse is of nothing, as AutoCAD's
IsNull: its major axis of no length, or its ratio nought.
- IsPeriodic
Gets whether the ellipse runs round on itself, as AutoCAD's
IsPeriodic: true for a whole one.
- MajorAxis
Gets the vector from the centre to the end of the long axis (groups 11, 21, 31), in world coordinates, as AutoCAD's
MajorAxis; (1, 0, 0) where the record gives none. It is set with the rest by Set(GeoPoint3, GeoVector3, GeoVector3, double, double, double).
- MajorRadius
Gets the length of the major axis, as AutoCAD's
MajorRadius.
- MinorAxis
Gets the vector from the centre to the end of the short axis, as AutoCAD's
MinorAxis: the Normal crossed with the major axis, MinorRadius long.
- MinorRadius
Gets the length of the minor axis, the major radius times the RadiusRatio, as AutoCAD's
MinorRadius.
- Normal
Gets the normal of the ellipse (groups 210, 220, 230), of unit length, as AutoCAD's
Normal; (0, 0, 1) where the record gives none. It is set with the rest by Set(GeoPoint3, GeoVector3, GeoVector3, double, double, double).
- RadiusRatio
Gets or sets the minor radius over the major (group 40), as AutoCAD's
RadiusRatio; 1 where the record gives none. Set, the parameters are kept, so the ends keep their eccentric angles.
- StartAngle
Gets or sets the angle of the start of the ellipse, as AutoCAD's
StartAngle: of the line from the centre to it, in radians from the major axis counter-clockwise about the normal, from nought up to 2 pi; not the parameter, which the file holds (group 41), but worked out from it and the RadiusRatio.
- StartParam
Gets or sets the parameter at the start of the ellipse (group 41), as AutoCAD's
StartParam: an eccentric angle in radians; nought where the record gives none.
Methods
- Extend(bool, GeoPoint3)
Extends a part of an ellipse at one end round the ellipse to a point of it, as AutoCAD's
Extend.
- Extend(double)
Extends a part of an ellipse round the ellipse to a parameter past one of its ends, as AutoCAD's
Extend: below StartParam moves its start back, above EndParam moves its end on.
- GetAngleAtParameter(double)
Gets the angle from the major axis of the point at a parameter, as AutoCAD's
GetAngleAtParameter, from nought up to 2 pi; 2 pi at the parameter 2 pi. On the ellipse of ratio 0.5 the parameter pi / 4 is at the angle 0.4636.
- GetClosestPointTo(GeoPoint3, bool)
Gets the point of the ellipse nearest a point, as AutoCAD's
GetClosestPointTo: on the whole ellipse where it is whole or extended, else on its part, an end where that is nearer.
- GetDistAtPoint(GeoPoint3)
Gets the distance along the ellipse from its start to a point of it.
- GetDistanceAtParameter(double)
Gets the distance along the ellipse from its start to a parameter, as AutoCAD's
GetDistanceAtParameter.
- GetFirstDerivative(double)
Gets the derivative of the ellipse at a parameter, as AutoCAD's
GetFirstDerivative: the minor axis times the cosine less the major axis times the sine.
- GetOffsetCurves(double)
Gets the curve at a distance from the ellipse, as AutoCAD's
GetOffsetCurves: not an ellipse, so a DxfSpline, as AutoCAD gives one, of the ellipse's look in no file: its Spline offset as GetOffsetCurvesGivenPlaneNormal(GeoVector3, double) offsets one about the ellipse's normal, outwards where the distance is above nought, as a circle's radius grows. The curve 1 out from the ellipse of radii 10 and 5 keeps 1 from it within the 1E-3 the spline is fitted to.
- GetOffsetCurvesGivenPlaneNormal(GeoVector3, double)
Gets the curve at a distance from the ellipse in the plane of a normal, as AutoCAD's
GetOffsetCurvesGivenPlaneNormal: as GetOffsetCurves(double), the plane being the ellipse's own and the side outwards for a distance above nought whichever way the normal given points, as a circle's.
- GetParameterAtAngle(double)
Gets the parameter of the point at an angle from the major axis, as AutoCAD's
GetParameterAtAngle, from nought up to 2 pi; 2 pi at the angle 2 pi.
- GetParameterAtDistance(double)
Gets the parameter at a distance along the ellipse from its start, as AutoCAD's
GetParameterAtDistance.
- GetParameterAtPoint(GeoPoint3)
Gets the parameter at a point of the ellipse, as AutoCAD's
GetParameterAtPoint: its eccentric angle, from StartParam to EndParam.
- GetPointAtDist(double)
Gets the point at a distance along the ellipse from its start.
- GetPointAtParameter(double)
Gets the point at a parameter, an eccentric angle, as AutoCAD's
GetPointAtParameter: the centre, the major axis times its cosine and the minor axis times its sine.
- GetSecondDerivative(double)
Gets the second derivative of the ellipse at a parameter: from the point to the centre.
- GetSplitCurves(IReadOnlyList<double>)
Gets the pieces the ellipse is cut into at parameters, as AutoCAD's
GetSplitCurves: parts of it of the same look in no file. A part is cut from its start to the first parameter, on to the next and to its end; a whole one from each parameter to the next round it and from the last round to the first, given whole where it is cut at fewer than two places. A parameter at an end or within the point tolerance along it of another cuts nothing.
- ReverseCurve()
Turns the ellipse to run from its end to its start, as AutoCAD's
ReverseCurve: its normal turned over, which turns its minor axis over, its major axis kept, and its parameters those of its old end and start under that. The record is written once.
- Set(GeoPoint3, GeoVector3, GeoVector3, double, double, double)
Gives the ellipse a new centre, normal, major axis, ratio and end angles at once, as AutoCAD's
Set: the record is written once, every other group kept.
- SetFromGeCurve(object)
Gives the ellipse the centre, normal, axes and radii of a whole GeoEllipse3, as AutoCAD's
SetFromGeCurve, or of a GeoEllipse2 at z = 0 on the normal (0, 0, 1), each written as DxfWriter writes one.
- ToGeoEllipse2()
Gets the whole ellipse in the plane, as DxfReader reads it with PlanAs2D within the default tolerance: the ellipse about (0, 0, 0) with the end of its major axis at (60, 0, 0) and a ratio of 0.5 is the GeoEllipse2 of radii 60 and 30 along x. One at a height, or on a normal other than (0, 0, 1) and (0, 0, -1), does not lie on the floor, and is refused; so is a part of an ellipse, which ToGeoSpline2() gives.
- ToGeoEllipse2(Tolerance)
Gets the whole ellipse in the plane, as ToGeoEllipse2() does, within a tolerance, which says whether its major axis has a length.
- ToGeoEllipse3()
Gets the whole ellipse as the library's, as AutoCAD's
GetGeCurveand the AutoCAD bridge'sToGeoEllipse3give it: the shape GetGeometry() gives, to the bit. The ellipse about (0, 0, 0) with the end of its major axis at (60, 0, 0) and a ratio of 0.5 is the GeoEllipse3 of radii 60 and 30. A part of an ellipse is refused: ToGeoSpline3() gives it, as the reader reads it, exactly.
- ToGeoSpline2()
Gets a part of an ellipse in the plane as the spline that is exactly that part, as DxfReader reads it with PlanAs2D within the default tolerance, in the direction of the file. One that does not lie on the floor is refused, and so is a whole ellipse, which ToGeoEllipse2() gives.
- ToGeoSpline2(Tolerance)
Gets a part of an ellipse in the plane as the spline that is exactly that part, as ToGeoSpline2() does, within a tolerance, which says whether its major axis has a length.
- ToGeoSpline3()
Gets a part of an ellipse as the spline that is exactly that part, as GetGeometry() gives it, to the bit: rational quadratic pieces of at most a quarter turn of its eccentric angle, so a quarter of the ellipse 60 by 30 is a GeoSpline3 of 3 control points. A whole ellipse is refused: ToGeoEllipse3() gives it, and Spline the spline of a whole one.