Circle
References[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 136)]
[Serializable]
public struct Circle : IEpsilonComparable<Circle>, ICloneable
Represents a circle in 3D.
The values used are a radius and an orthonormal frame of the plane containing the circle, with origin at the center.
The circle is parameterized by radians from 0 to 2 Pi given by
t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis
where center, xaxis and yaxis define the orthonormal frame of the circle plane.
Remarks: >An IsValid circle has positive radius and an IsValid plane defining the frame.
Constructors
Initializes a circle from an arc.
Parameters:
| arc (Arc) | Arc that defines the plane and radius. |
Initializes a circle with center (0,0,0) in the world XY plane.
Parameters:
| radius (double) | Radius of circle, should be a positive number. |
Initializes a circle on a plane with a given radius.
Initializes a circle parallel to a given plane with given center and radius.
Initializes a circle parallel to the world XY plane with given center and radius.
Initializes a circle through three 3d points.
Initializes a circle from two 3d points and a tangent at the first point. The start/end of the circle is at point "startPoint".
Properties
Gets the circle's 3d axis aligned bounding box.
Returns: 3d bounding box.
Gets or sets the circumference of this circle.
Gets or sets the diameter (radius * 2.0) of this circle. Diameters should be positive values.
A valid circle has radius larger than 0.0 and a base plane which is must also be valid.
Gets or sets the radius of this circle. Radii should be positive values.
Methods
Gets the parameter on the circle which is closest to a test point.
Gets the point on the circle which is closest to a test point.
Parameters:
| testPoint (Point3d) | Point to project onto the circle. |
Returns: The point on the circle that is closest to testPoint or Point3d.Unset on failure.
Determines the value of the Nth derivative at a parameter.
Check that all values in other are within epsilon of the values in this
Implements: EpsilonEquals
Evaluates whether or not this circle is co-planar with a given plane.
Circles use trigonometric parameterization: t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis.
Parameters:
| t (double) | Parameter of point to evaluate. |
Returns: The point on the circle at the given parameter.
public void Reverse()
Reverse the orientation of the circle. Changes the domain from [a,b] to [-b,-a].
Rotates the circle through a given angle.
Rotates the circle through a given angle.
Rotates the circle around an axis that starts at the provided point.
Rotates the circle around an axis that starts at the base plane origin.
Circles use trigonometric parameterization: t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis.
Parameters:
| t (double) | Parameter of tangent to evaluate. |
Returns: The tangent at the circle at the given parameter.
Constructs a nurbs curve representation of this circle. This amounts to the same as calling NurbsCurve.CreateFromCircle().
Returns: A nurbs curve representation of this circle or null if no such representation could be made.
Create a uniform non-rational cubic NURBS approximation of a circle.
Transforms this circle using an transformation matrix.
Remarks: Circles may not be transformed accurately if the transformation defines a non-euclidean transformation.
Parameters:
| xform (Transform) | Transformation to apply. |
Returns: true on success, false on failure.
Moves the circle.
Parameters:
| delta (Vector3d) | Translation vector. |
Returns: true on success, false on failure.
Attempt to fit a circle through a set of points.
Parameters:
| points (IEnumerable<Point3d>) | The points through which to fit. |
| circle (out Circle) | The resulting circle on success. |
Returns: true on success, false on failure.
Try to fit a circle to two curves using tangent relationships.
Try to fit a circle to three curves using tangent relationships.
Parameters:
| c1 (Curve) | First curve to touch. |
| c2 (Curve) | Second curve to touch. |
| c3 (Curve) | Third curve to touch. |
| t1 (double) | Parameter on first curve close to desired solution. |
| t2 (double) | Parameter on second curve closet to desired solution. |
| t3 (double) | Parameter on third curve close to desired solution. |
Returns: Valid circle on success, Circle.Unset on failure.
public static bool TrySmallestEnclosingCircle(IEnumerable<Point2d> points, double tolerance, out Circle circle, out int[] indicesOnCircle)
Attempt to create the smallest circle enclosing a set of planar points.
Parameters:
| points (IEnumerable<Point2d>) | The points to enclose. |
| tolerance (double) | The tolerance to use |
| circle (out Circle) | The resulting circle on success. |
| indicesOnCircle (out int[]) | If possible, indices of two or three points that define the circle |
Returns: true on success, false on failure.