[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

Circle

#Since v5.0
Initializes a circle from an arc.
public Circle(
arc
Arc that defines the plane and radius.
)

Circle

#Since v5.0
Initializes a circle with center (0,0,0) in the world XY plane.
public Circle(
radius
Radius of circle, should be a positive number.
)

Circle

#ExampleSince v5.0
Initializes a circle on a plane with a given radius.
public Circle(
plane,
Plane of circle. Plane origin defines the center of the circle.
radius
Radius of circle (should be a positive value).
)

Circle

#Since v5.0
Initializes a circle parallel to a given plane with given center and radius.
public Circle(
plane,
Plane for circle.
center,
Center point override.
radius
Radius of circle (should be a positive value).
)

Circle

#ExampleSince v5.0
Initializes a circle parallel to the world XY plane with given center and radius.
public Circle(
center,
Center of circle.
radius
Radius of circle (should be a positive value).
)

Circle

#Since v5.0
Initializes a circle through three 3d points.
public Circle(
point1,
The start/end of the circle is at point1.
point2,
Second point on the circle.
point3
Third point on the circle.
)

Circle

#Since v5.0
Initializes a circle from two 3d points and a tangent at the first point. The start/end of the circle is at point "startPoint".
public Circle(
startPoint,
Start point of circle.
tangentAtP,
Tangent vector at start.
pointOnCircle
Point coincident with desired circle.
)
Remarks: May create an Invalid circle

Properties

BoundingBox

#Since v5.0
Gets the circle's 3d axis aligned bounding box.
public BoundingBox BoundingBox { get; }
3d bounding box.

Center

#Since v5.0
Gets or sets the center point of this circle.
public Point3d Center { get; set; }

Circumference

#Since v5.0
Gets or sets the circumference of this circle.
public double Circumference { get; set; }

Diameter

#Since v5.0
Gets or sets the diameter (radius * 2.0) of this circle. Diameters should be positive values.
public double Diameter { get; set; }

IsValid

#Since v5.0
A valid circle has radius larger than 0.0 and a base plane which is must also be valid.
public bool IsValid { get; }

Normal

#Since v5.0
Gets the normal vector for this circle.
public Vector3d Normal { get; }

Plane

#Since v5.0
Gets or sets the plane of the circle.
public Plane Plane { get; set; }

Radius

#Since v5.0
Gets or sets the radius of this circle. Radii should be positive values.
public double Radius { get; set; }

Unset

#Since v5.0
Gets a circle with Unset components.
public static Circle Unset { get; }

Methods

ClosestParameter

#Since v5.0
Gets the parameter on the circle which is closest to a test point.
[ConstOperation] public bool ClosestParameter(
testPoint,
Point to project onto the circle.
out double
t
Parameter on circle closes to testPoint.
)
true on success, false on failure.

ClosestPoint

#Since v5.0
Gets the point on the circle which is closest to a test point.
[ConstOperation] public Point3d ClosestPoint(
testPoint
Point to project onto the circle.
)
The point on the circle that is closest to testPoint or Point3d.Unset on failure.

DerivativeAt

#Since v5.0
Determines the value of the Nth derivative at a parameter.
[ConstOperation] public Vector3d DerivativeAt(
derivative,
Which order of derivative is wanted.
t
Parameter to evaluate derivative. Valid values are 0, 1, 2 and 3.
)
The derivative of the circle at the given parameter.

EpsilonEquals

#Since v5.4
Check that all values in other are within epsilon of the values in this
[ConstOperation] public bool EpsilonEquals(
other,
epsilon
)
EpsilonEquals

IsInPlane

#Since v5.0
Evaluates whether or not this circle is co-planar with a given plane.
[ConstOperation] public bool IsInPlane(
plane,
Plane.
tolerance
Tolerance to use.
)
true if the circle plane is co-planar with the given plane within tolerance.

PointAt

#Since v5.0
Circles use trigonometric parameterization: t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis.
[ConstOperation] public Point3d PointAt(
t
Parameter of point to evaluate.
)
The point on the circle at the given parameter.

Reverse

#Since v5.0
Reverse the orientation of the circle. Changes the domain from [a,b] to [-b,-a].
public void Reverse()

Rotate

#Since v5.0
Rotates the circle through a given angle.
public bool Rotate(
angle,
Angle (in radians) of the rotation.
axis,
Rotation axis.
point
Rotation anchor point.
)
true on success, false on failure.

Rotate

#Since v5.0
Rotates the circle through a given angle.
public bool Rotate(
angle,
Angle (in radians) of the rotation.
axis
Rotation axis.
)
true on success, false on failure.

Rotate

#Since v5.0
Rotates the circle around an axis that starts at the provided point.
public bool Rotate(
sinAngle,
The value returned by Math.Sin(angle) to compose the rotation.
cosAngle,
The value returned by Math.Cos(angle) to compose the rotation.
axis,
A rotation direction.
point
A rotation base point.
)
true on success, false on failure.

Rotate

#Since v5.0
Rotates the circle around an axis that starts at the base plane origin.
public bool Rotate(
sinAngle,
The value returned by Math.Sin(angle) to compose the rotation.
cosAngle,
The value returned by Math.Cos(angle) to compose the rotation.
axis
A rotation axis.
)
true on success, false on failure.
Explicit

ICloneable.Clone

#

TangentAt

#Since v5.0
Circles use trigonometric parameterization: t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis.
[ConstOperation] public Vector3d TangentAt(
t
Parameter of tangent to evaluate.
)
The tangent at the circle at the given parameter.

ToNurbsCurve

#Since v5.0
Constructs a nurbs curve representation of this circle. This amounts to the same as calling NurbsCurve.CreateFromCircle().
[ConstOperation] public NurbsCurve ToNurbsCurve()
A nurbs curve representation of this circle or null if no such representation could be made.

ToNurbsCurve

#Since v6.0
Create a uniform non-rational cubic NURBS approximation of a circle.
[ConstOperation] public NurbsCurve ToNurbsCurve(
degree,
>=1
cvCount
cv count >=5
)
NURBS curve approximation of a circle on success

Transform

#Since v5.0
Transforms this circle using an transformation matrix.
public bool Transform(
Transform
xform
Transformation to apply.
)
Remarks: Circles may not be transformed accurately if the transformation defines a non-euclidean transformation.
true on success, false on failure.

Translate

#Since v5.0
Moves the circle.
public bool Translate(
delta
Translation vector.
)
true on success, false on failure.

TryFitCircleToPoints

#Since v6.2
Attempt to fit a circle through a set of points.
public static bool TryFitCircleToPoints(
points,
The points through which to fit.
out Circle
circle
The resulting circle on success.
)
true on success, false on failure.

TryFitCircleTT

#Since v5.0
Try to fit a circle to two curves using tangent relationships.
public static Circle TryFitCircleTT(
c1,
First curve to touch.
c2,
Second curve to touch.
t1,
Parameter on first curve close to desired solution.
t2
Parameter on second curve closet to desired solution.
)
Valid circle on success, Circle.Unset on failure.

TryFitCircleTTT

#Since v5.0
Try to fit a circle to three curves using tangent relationships.
public static Circle TryFitCircleTTT(
c1,
First curve to touch.
c2,
Second curve to touch.
c3,
Third curve to touch.
t1,
Parameter on first curve close to desired solution.
t2,
Parameter on second curve closet to desired solution.
t3
Parameter on third curve close to desired solution.
)
Valid circle on success, Circle.Unset on failure.

TrySmallestEnclosingCircle

#Since v8.4
Attempt to create the smallest circle enclosing a set of planar points.
public static bool TrySmallestEnclosingCircle(
points,
The points to enclose.
tolerance,
The tolerance to use
out Circle
circle,
The resulting circle on success.
out int[]
indicesOnCircle
If possible, indices of two or three points that define the circle
)
true on success, false on failure.