Class DxfCircle
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
A CIRCLE of a DXF file, as AutoCAD's Circle: the circle of Radius about Center, in
the plane square to its Normal, with the Thickness it stands up along the normal.
public sealed class DxfCircle : DxfCurve
- Inheritance
-
DxfCircle
- Inherited Members
Remarks
The circle of radius 5 about (10, 20, 0) is Diameter 10, Circumference 31.416 and Area 78.540. Its parameter is the angle in radians, as AutoCAD's is: from nought at the point on the x axis of the normal's own system, (15, 20, 0) here, counter-clockwise seen from the tip of the normal to 2 pi back at that point.
The file holds the centre in the system the normal makes by the arbitrary axis algorithm of the DXF reference; the
centre here is in world coordinates, as AutoCAD gives it, and is written back into that system. A circle of a file
whose normal is (0, 0, -1) and whose groups 10, 20 and 30 are (10, 20, 5) has its centre at (-10, 20, -5). Setting
the normal keeps the centre where it is in the world. Every other group of the record is kept as it was;
new DxfCircle(center, normal, radius) { Layer = "steel" } makes one in code, to be added to a drawing by
AppendEntity(DxfEntity).
Constructors
- DxfCircle()
Initializes a circle of no radius at the origin on the normal (0, 0, 1), as AutoCAD's
new Circle(), on layer 0 in no file; give it its radius before it is drawn.
- DxfCircle(GeoPoint3, GeoVector3, double)
Initializes a circle about a centre in the plane square to a normal, as AutoCAD's
new Circle(center, normal, radius), on layer 0 with no look of its own, in no file until it is added to one.
Properties
- Area
Gets the area within the circle, pi times the square of its radius; 78.540 for a radius of 5.
- Center
Gets or sets the centre of the circle, in world coordinates, as AutoCAD's
Center: the groups 10, 20 and 30 taken from the system of the Normal into the world; the origin where the record gives none.
- Circumference
Gets or sets the length round the circle, 2 pi times its Radius, as AutoCAD's
Circumference.
- Closed
Gets true: a circle is closed.
- EndParam
Gets the parameter at the end of the circle: 2 pi, the angle of a whole turn, as AutoCAD's.
- IsPeriodic
Gets true: a circle runs round on itself, as AutoCAD's
IsPeriodicsays of one.
- Normal
Gets or sets the normal of the circle (groups 210, 220, 230), square to its plane, of unit length; (0, 0, 1) where the record gives none. Set, the centre keeps its place in the world, as AutoCAD keeps it: the circle turns about it.
- Radius
Gets or sets the radius of the circle (group 40), as AutoCAD's
Radius; 1 where the record gives none.
- Thickness
Gets or sets how far the circle stands up along its Normal (group 39), a tube of that height; nought where the record gives none.
Methods
- Extend(bool, GeoPoint3)
Refuses, as AutoCAD does: a circle is closed and has no end to be extended.
- Extend(double)
Refuses, as AutoCAD does: a circle is closed and has no end to be extended.
- GetClosestPointTo(GeoPoint3, bool)
Gets the point of the circle nearest a point, as AutoCAD's
GetClosestPointTo: that of the point seen along the normal; the start for the centre itself or a point on the axis through it.
- GetDistAtPoint(GeoPoint3)
Gets the distance along the circle from its start to a point of it.
- GetDistanceAtParameter(double)
Gets the distance along the circle from its start to a parameter: the radius times the angle.
- GetFirstDerivative(double)
Gets the derivative of the circle at a parameter, as AutoCAD's
GetFirstDerivative: the tangent, of the length of the radius, pointing the way the angle grows.
- GetOffsetCurves(double)
Gets the circle at a distance from this one, as AutoCAD's
GetOffsetCurves: about the same centre, its radius the larger by the distance, so that a distance above nought offsets it outwards.
- GetOffsetCurvesGivenPlaneNormal(GeoVector3, double)
Gets the circle at a distance from this one in the plane of a normal, as AutoCAD's
GetOffsetCurvesGivenPlaneNormal: as GetOffsetCurves(double), the plane being the circle's own, its radius growing with a distance above nought whichever way the normal given points, as AutoCAD offsets a circle by its radius. An arc, a circle and an ellipse are the exceptions to the side every other curve offsets to, the right seen from the tip of the normal given.
- GetParameterAtDistance(double)
Gets the parameter at a distance along the circle from its start: the distance over the radius.
- GetParameterAtPoint(GeoPoint3)
Gets the parameter at a point of the circle, its angle from the x axis of the normal's own system, as AutoCAD's
GetParameterAtPoint: from nought up to 2 pi.
- GetPointAtDist(double)
Gets the point at a distance along the circle from its start.
- GetPointAtParameter(double)
Gets the point at a parameter, an angle in radians from the x axis of the normal's own system, as AutoCAD's
GetPointAtParameter.
- GetSecondDerivative(double)
Gets the second derivative of the circle at a parameter: from the point to the centre, of the length of the radius.
- GetSplitCurves(IReadOnlyList<double>)
Gets the pieces the circle is cut into at parameters, as AutoCAD's
GetSplitCurves: arcs of the same look in no file, from each angle to the next counter-clockwise and from the last round to the first. The angles are taken round the circle from nought; one within the point tolerance along the circle of another cuts nothing, and a circle cut at fewer than two places is given whole, as a copy.
- ReverseCurve()
Turns the circle to run the other way, as AutoCAD's
ReverseCurve: its normal turned over, its centre kept where it is in the world.
- SetFromGeCurve(object)
Gives the circle the centre, normal and radius of a GeoCircle3, as AutoCAD's
SetFromGeCurve, or of a GeoCircle2 at z = 0 on the normal (0, 0, 1), each written as DxfWriter writes one.
- ToGeoCircle2()
Gets the circle in the plane, as DxfReader reads it with PlanAs2D within the default tolerance: the circle of radius 10 about (0, 0, 0) is the GeoCircle2 of radius 10 about (0, 0); one on the normal (0, 0, -1), as AutoCAD writes a mirrored circle, has the x of its centre turned over. One at a height of 5, or on a tilted normal, does not lie on the floor, and is refused.
- ToGeoCircle2(Tolerance)
Gets the circle in the plane, as ToGeoCircle2() does, within a tolerance, which says whether it has a radius.
- ToGeoCircle3()
Gets the circle as the library's, as AutoCAD's
GetGeCurveand the AutoCAD bridge'sToGeoCircle3give it: the shape GetGeometry() gives, to the bit. The circle of radius 10 about (0, 0, 5) is the GeoCircle3 of that centre and radius on the normal (0, 0, 1).