Arc
References[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 152)]
[Serializable]
public struct Arc : IEquatable<Arc>, IEpsilonComparable<Arc>, ICloneable
Represents the value of a plane, two angles and a radius in a sub-curve of a three-dimensional circle.
The curve is parameterized by an angle expressed in radians. For an IsValid arc the total subtended angle AngleRadians() = Domain()(1) - Domain()(0) must satisfy 0 < AngleRadians() < 2*Pi
The parameterization of the Arc is inherited from the Circle it is derived from. In particular
t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis
where xaxis and yaxis, (part of Circle.Plane) form an orthonormal frame of the plane containing the circle.
Constructors
Initializes a new instance of an arc from a base circle and an angle.
Initializes a new instance of an arc from a base circle and an interval of angles.
Initializes a new arc from a base plane, a radius value and an angle.
Initializes a new aligned arc at the given center point, with a custom radius and angle.
Initializes a new horizontal arc at the given center point, with a custom radius and angle.
Initializes a new arc from end points and a tangent vector. If the tangent is parallel with the line segment between the two endpoints this will result in an Invalid arc.
Initializes a new arc through three points. If the points are coincident or co-linear, this will result in an Invalid arc.
Properties
Gets or sets the sweep -or subtended- angle (in Radians) for this arc segment. Setting this property only alters the EndAngle property such that Angle = EndAngle - StartAngle.
Gets or sets the sweep -or subtended- angle (in Degrees) for this arc segment.
Gets or sets the angle domain (in Radians) of this arc.
Gets the circumference of the circle that is coincident with this arc.
Gets or sets the end angle (in Radians) for this arc segment.
Gets or sets the end angle (in Degrees) for this arc segment.
Gets a value indicating whether or not this arc is a complete circle.
Gets a value indicating whether or not this arc is valid. Detail: Radius>0 and 0<AngleRadians()<=2*Math.Pi.
Returns: true if the arc is valid.
Gets the length of the arc. (Length = Radius * (subtended angle in radians)).
Gets or sets the start angle (in Radians) for this arc segment.
Gets or sets the start angle (in Degrees) for this arc segment.
Methods
Computes the 3D axis aligned bounding box for this arc.
Returns: Bounding box of arc.
Gets parameter on the arc closest to a test point.
Parameters:
| testPoint (Point3d) | Point to get close to. |
Returns: Parameter (in radians) of the point on the arc that is closest to the test point. If testPoint is the center of the arc, then the starting point of the arc is (arc.Domain()[0]) returned. If no parameter could be found, RhinoMath.UnsetValue is returned.
Computes the point on an arc that is closest to a test point.
Parameters:
| testPoint (Point3d) | Point to get close to. |
Returns: The point on the arc that is closest to testPoint. If testPoint is the center of the arc, then the starting point of the arc is returned. UnsetPoint on failure.
Check that all values in other are within epsilon of the values in this
Implements: EpsilonEquals
Determines whether another arc has the same value as this arc.
Parameters:
| other (Arc) | An arc. |
Returns: true if obj is equal to this arc; otherwise false.
Equals
#Determines whether another object is an arc and has the same value as this arc.
Parameters:
| obj (object) | An object. |
Returns: true if obj is an arc and is exactly equal to this arc; otherwise false.
Overrides: ValueType.Equals
GetHashCode
#Computes a hash code for the present arc.
Returns: A non-unique integer that represents this arc.
Overrides: ValueType.GetHashCode
Gets the point at the given arc parameter.
Parameters:
| t (double) | Arc parameter to evaluate. |
Returns: The point at the given parameter.
public void Reverse()
Reverses the orientation of the arc. Changes the domain from [a,b] to [-b,-a].
Gets the tangent at the given parameter.
Parameters:
| t (double) | Parameter of tangent to evaluate. |
Returns: The tangent at the arc at the given parameter.
Initializes a nurbs curve representation of this arc. This amounts to the same as calling NurbsCurve.CreateFromArc().
Returns: A nurbs curve representation of this arc or null if no such representation could be made.
Create a uniform non-rational cubic NURBS approximation of an arc.
Transforms the arc using a Transformation matrix.
Parameters:
| xform (Transform) | Transformations to apply. Note that arcs cannot handle non-euclidean transformations. |
Returns: true on success, false on failure.
Sets the arc's angle domain (in radians) to the specified interval, provided it is increasing and its length does not exceed 2.0 * Math.PI (plus a small tolerance). If the interval length exceeds 2.0 * Math.PI it will be clamped to exactly 2.0 * Math.PI. Returns true if the domain was set successfully, false otherwise.
Parameters:
| domain (Interval) | The desired angle domain in radians. Must satisfy domain[0] < domain[1] and domain[1] - domain[0] <= 2.0 * Math.PI + tolerance. |
Returns: True if the domain was set successfully; false if the interval is not increasing or exceeds the allowed length.