Show / Hide Table of Contents

    Class Arc

    An arc defined as a CCW rotation from the +X axis around a center between a start angle and an end angle.

    Examples
    var arc = new Arc(Vector3.Origin, 2.0, 0.0, 90.0);
    Assert.True(new Vector3(2, 0, 0).IsAlmostEqualTo(arc.Start));
    Assert.True(new Vector3(0, 2, 0).IsAlmostEqualTo(arc.End));
    
    var arc1 = new Arc(Vector3.Origin, 2.0, 0.0, -90.0);
    Assert.True(new Vector3(2, 0, 0).IsAlmostEqualTo(arc1.Start));
    Assert.True(new Vector3(0, -2, 0).IsAlmostEqualTo(arc1.End));
    
    // A transformed arc.
    var arc2 = new Arc(new Transform(Vector3.Origin, Vector3.XAxis), 2.0, 0, Math.PI);
    
    Inheritance
    System.Object
    Curve
    BoundedCurve
    TrimmedCurve<Circle>
    Arc
    Implements
    ICurve
    ITransformable<Curve>
    IBoundedCurve
    ITrimmedCurve<Circle>
    System.IEquatable<Arc>
    Inherited Members
    TrimmedCurve<Circle>.BasisCurve
    BoundedCurve.DefaultMinimumChordLength
    BoundedCurve.IsClosedForRendering
    BoundedCurve.Frames(Double, Double, Double)
    BoundedCurve.PointAtNormalized(Double)
    BoundedCurve.TransformAtNormalized(Double)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Elements.Geometry
    Assembly: Hypar.Elements.dll
    Syntax
    public class Arc : TrimmedCurve<Circle>, ICurve, ITransformable<Curve>, IBoundedCurve, ITrimmedCurve<Circle>, IEquatable<Arc>

    Constructors

    Arc(Circle, Double, Double)

    Create an arc.

    Declaration
    public Arc(Circle circle, double startParameter, double endParameter)
    Parameters
    Type Name Description
    Circle circle

    The circle on which this arc is based.

    System.Double startParameter

    The parameter, from 0.0->2PI, of the start of the arc.

    System.Double endParameter

    The parameter, from 0.0->2PI, of the end of the arc.

    Arc(Transform, Double, Double, Double)

    Create an arc. Constructs a circular basis curve internally with the provided transform.

    Declaration
    public Arc(Transform transform, double radius = 1, double startParameter = 0, double endParameter = 6.2831853071795862)
    Parameters
    Type Name Description
    Transform transform

    The transform for the basis curve of the arc.

    System.Double radius

    The radius of the arc.

    System.Double startParameter

    The parameter, from 0.0->2PI, of the start of the arc.

    System.Double endParameter

    The parameter, from 0.0->2PI, of the end of the arc.

    Arc(Vector3, Double, Double, Double)

    Create an arc.

    Declaration
    [JsonConstructor]
    public Arc(Vector3 center, double radius, double startAngle, double endAngle)
    Parameters
    Type Name Description
    Vector3 center

    The center of the arc.

    System.Double radius

    The radius of the arc.

    System.Double startAngle

    The angle from 0.0, in degrees, at which the arc will start with respect to the positive X axis.

    System.Double endAngle

    The angle from 0.0, in degrees, at which the arc will end with respect to the positive X axis.

    Remarks

    If the end angle is smaller than the start angle, they will be flipped and the underlying circle reversed to preserve a positive parameter domain.

    Arc(Double)

    Create a circular arc.

    Declaration
    public Arc(double radius)
    Parameters
    Type Name Description
    System.Double radius

    Arc(Double, Double, Double)

    Create an arc. Constructs a circular basis curve internally with a default transform.

    Declaration
    public Arc(double radius, double startAngle, double endAngle)
    Parameters
    Type Name Description
    System.Double radius

    The radius of the arc.

    System.Double startAngle

    The CCW angle from 0.0, in degrees, at which the arc will start with respect to the positive X axis.

    System.Double endAngle

    The CCW angle from 0.0, in degrees, at which the arc will end with respect to the positive X axis.

    Properties

    Center

    The center of the arc.

    Declaration
    public Vector3 Center { get; }
    Property Value
    Type Description
    Vector3

    Domain

    The domain of the curve.

    Declaration
    [JsonIgnore]
    public override Domain1d Domain { get; }
    Property Value
    Type Description
    Domain1d
    Overrides
    BoundedCurve.Domain

    End

    The end point of the arc.

    Declaration
    [JsonIgnore]
    public override Vector3 End { get; }
    Property Value
    Type Description
    Vector3
    Overrides
    BoundedCurve.End

    EndAngle

    The angle from 0.0, in degrees, at which the arc will end with respect to the positive X axis.

    Declaration
    [JsonProperty("EndAngle", Required = Required.Always)]
    public double EndAngle { get; protected set; }
    Property Value
    Type Description
    System.Double

    Radius

    The radius of the arc.

    Declaration
    public double Radius { get; }
    Property Value
    Type Description
    System.Double

    Start

    The start point of the arc.

    Declaration
    [JsonIgnore]
    public override Vector3 Start { get; }
    Property Value
    Type Description
    Vector3
    Overrides
    BoundedCurve.Start

    StartAngle

    The angle from 0.0, in degrees, at which the arc will start with respect to the positive X axis.

    Declaration
    [JsonProperty("StartAngle", Required = Required.Always)]
    public double StartAngle { get; protected set; }
    Property Value
    Type Description
    System.Double

    Methods

    ArcLength(Double, Double)

    Calculate the length of the arc between start and end parameters.

    Declaration
    public override double ArcLength(double start, double end)
    Parameters
    Type Name Description
    System.Double start
    System.Double end
    Returns
    Type Description
    System.Double
    Overrides
    BoundedCurve.ArcLength(Double, Double)

    Bounds()

    Get a bounding box for this arc.

    Declaration
    public override BBox3 Bounds()
    Returns
    Type Description
    BBox3

    A bounding box for this arc.

    Overrides
    BoundedCurve.Bounds()

    ByThreePoints(Vector3, Vector3, Vector3)

    Create an arc by three points.

    Declaration
    public static Arc ByThreePoints(Vector3 a, Vector3 b, Vector3 c)
    Parameters
    Type Name Description
    Vector3 a

    The first point.

    Vector3 b

    The second point.

    Vector3 c

    The third point.

    Returns
    Type Description
    Arc

    An arc through the three points.

    Complement()

    Return the arc which is the complement of this arc.

    Declaration
    public Arc Complement()
    Returns
    Type Description
    Arc

    Equals(Arc)

    Is this arc equal to the provided arc?

    Declaration
    public bool Equals(Arc other)
    Parameters
    Type Name Description
    Arc other

    The arc to test.

    Returns
    Type Description
    System.Boolean

    Returns true if the two arcs are equal, otherwise false.

    Fillet(Line, Line, Double)

    Create a fillet arc between two lines.

    Declaration
    public static Arc Fillet(Line a, Line b, double radius)
    Parameters
    Type Name Description
    Line a

    The first line.

    Line b

    The second line.

    System.Double radius

    The radiuse of the fillet arc.

    Returns
    Type Description
    Arc

    A fillet arc between the two lines.

    GetSubdivisionParameters(Double, Double)

    Get parameters to be used to find points along the curve for visualization.

    Declaration
    public override double[] GetSubdivisionParameters(double startSetbackDistance = 0, double endSetbackDistance = 0)
    Parameters
    Type Name Description
    System.Double startSetbackDistance

    An optional setback from the start of the curve.

    System.Double endSetbackDistance

    An optional setback from the end of the curve.

    Returns
    Type Description
    System.Double[]

    A collection of parameter values.

    Overrides
    BoundedCurve.GetSubdivisionParameters(Double, Double)

    Length()

    Calculate the length of the arc.

    Declaration
    public override double Length()
    Returns
    Type Description
    System.Double
    Overrides
    BoundedCurve.Length()

    Mid()

    The point at the middle of the curve's parameter space.

    Declaration
    public override Vector3 Mid()
    Returns
    Type Description
    Vector3
    Overrides
    BoundedCurve.Mid()

    ParameterAtDistanceFromParameter(Double, Double)

    Get the parameter at a distance from the start parameter along the curve.

    Declaration
    public override double ParameterAtDistanceFromParameter(double distance, double start)
    Parameters
    Type Name Description
    System.Double distance

    The distance from the start parameter.

    System.Double start

    The parameter from which to measure the distance.

    Returns
    Type Description
    System.Double
    Overrides
    Curve.ParameterAtDistanceFromParameter(Double, Double)

    Plane()

    Compute the plane of the arc.

    Declaration
    public Plane Plane()
    Returns
    Type Description
    Plane

    The plane in which the arc lies.

    PointAt(Double)

    Get the point at parameter u.

    Declaration
    public override Vector3 PointAt(double u)
    Parameters
    Type Name Description
    System.Double u
    Returns
    Type Description
    Vector3

    The point at parameter u if us is within the trim, otherwise an exception is thrown.

    Overrides
    Curve.PointAt(Double)

    Reversed()

    Get an arc which is the reverse of this Arc.

    Declaration
    public Arc Reversed()
    Returns
    Type Description
    Arc

    ToPolyline(Int32)

    Create a polyline through a set of points along the curve.

    Declaration
    public override Polyline ToPolyline(int divisions = 10)
    Parameters
    Type Name Description
    System.Int32 divisions

    The number of divisions of the curve.

    Returns
    Type Description
    Polyline

    A polyline.

    Overrides
    BoundedCurve.ToPolyline(Int32)

    TransformAt(Double)

    Get the transform at parameter u.

    Declaration
    public override Transform TransformAt(double u)
    Parameters
    Type Name Description
    System.Double u
    Returns
    Type Description
    Transform

    The transform at parameter u if us is within the trim, otherwise an exception is thrown.

    Overrides
    Curve.TransformAt(Double)

    Transformed(Transform)

    Create a transformed copy of this curve. Use of non-affine transforms (i.e. scale) will result in unpredictable results for curve methods such as Length().

    Declaration
    public override Curve Transformed(Transform transform)
    Parameters
    Type Name Description
    Transform transform

    The transform to apply.

    Returns
    Type Description
    Curve
    Overrides
    Curve.Transformed(Transform)

    TransformedArc(Transform)

    Construct a transformed copy of this Arc.

    Declaration
    public Arc TransformedArc(Transform transform)
    Parameters
    Type Name Description
    Transform transform

    The transform to apply.

    Returns
    Type Description
    Arc

    Implements

    ICurve
    ITransformable<T>
    IBoundedCurve
    ITrimmedCurve<TBasis>
    System.IEquatable<T>