Represent a circular arc.

The angle system behavior depends on the clockwise property:

  • If clockwise = false (counterclockwise): Angles are stored in normal mathematical sense (0° = +X axis, 90° = +Y axis, 180° = -X axis, 270° = -Y axis)
  • If clockwise = true: Angles are stored in a mirrored system where positive angles go clockwise (0° = +X axis, 270° = +Y axis, 180° = -X axis, 90° = -Y axis)

This means a "90° above X axis" in counterclockwise mode becomes "270°" in clockwise mode.

Hierarchy (View Summary)

Constructors

Properties

_boundingBoxNeedsUpdate: boolean
arcLengthDivisions: number
DEFAULT_CIRCLE_SIDES: 100

Default tessellation side count for a full circle. Matches the historical getPoints(100) sampling path.

MAX_CIRCLE_SIDES: 20000

Upper bound for AcGeTessellateOptions.circleSides (DXF VPORT range).

MIN_CIRCLE_SIDES: 8

Accessors

  • get boundingBoxNeedUpdate(): boolean
  • When this is set, it calculates the bounding box of this shape and resets this property to false. Default is false.

    Returns boolean

  • get box(): AcGeBox2d
  • The bounding box of this shape. Because it is a time-consuming operation to calculate the bounding box of one shape, the bounding box value is cached. It will be calculated again lazily once there are any changes to properties of this shape.

    Returns AcGeBox2d

  • get center(): AcGePoint2d
  • Center of circular arc

    Returns AcGePoint2d

  • set center(value: AcGeVector2dLike): void
  • Parameters

    Returns void

  • get clockwise(): boolean
  • Rotation direction of the arc.

    Returns boolean

  • set clockwise(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get closed(): boolean
  • Return true if its start point is identical to its end point. Otherwise, return false.

    Returns boolean

  • get deltaAngle(): number
  • Angle between endAngle and startAngle in range 0 to 2*PI

    Returns number

  • get endAngle(): number
  • End angle in radians of circular arc in the range 0 to 2 * PI. If clockwise=true, angles are mirrored (0 = +X, 270° = +Y, 180° = -X, 90° = -Y). If clockwise=false, angles are in normal mathematical sense (0 = +X, 90° = +Y, 180° = -X, 270° = -Y).

    Returns number

  • set endAngle(value: number): void
  • Parameters

    • value: number

    Returns void

  • get endPoint(): AcGePoint2d
  • End point of circular arc

    Returns AcGePoint2d

  • get length(): number
  • Get length of circular arc

    Returns number

  • get midPoint(): AcGePoint2d
  • Middle point of circular arc

    Returns AcGePoint2d

  • get radius(): number
  • Radius of circular arc

    Returns number

  • set radius(value: number): void
  • Parameters

    • value: number

    Returns void

  • get startAngle(): number
  • Start angle in radians of circular arc in the range 0 to 2 * PI. If clockwise=true, angles are mirrored (0 = +X, 270° = +Y, 180° = -X, 90° = -Y). If clockwise=false, angles are in normal mathematical sense (0 = +X, 90° = +Y, 180° = -X, 270° = -Y).

    Returns number

  • set startAngle(value: number): void
  • Parameters

    • value: number

    Returns void

  • get startPoint(): AcGePoint2d
  • Start point of circular arc

    Returns AcGePoint2d

Methods

  • Get total curve arc length.

    Returns number

    Return total curve arc length.

  • Get list of cumulative segment lengths.

    Parameters

    • Optionaldivisions: number

      Input number of pieces to divide the curve into.

    Returns number[]

    Return list of cumulative segment lengths.

  • Return the point for a given position on the curve according to the arc length.

    Parameters

    • _t: number

    Returns AcGePoint2d

    Return the point for a given position on the curve according to the arc length.

  • Return a point for a given position on the curve according to the arc length.

    Parameters

    • u: number

      Input a position on the curve according to the arc length. Must be in the range [0, 1].

    Returns AcGePoint2d

    Return a point for a given position on the curve according to the arc length.

  • Calculate a point on the ellipse at a given angle.

    Parameters

    • angle: number

      Input the angle in radians where the point is to be calculated.

    Returns AcGePoint2d

    Return the 2d coordinates of the point on the circular arc.

  • Divide this arc into the specified nubmer of points and return those points as an array of points.

    Parameters

    • OptionalnumPoints: number

      Input the nubmer of points returned

    Returns AcGePoint2d[]

    Return an array of points

  • Returns quadrant snap points (0°, 90°, 180°, 270°) that lie on this arc. For a full circle, all four points are returned.

    Returns AcGePoint2d[]

  • Return a set of divisions + 1 equi-spaced points using getPointAt(u).

    Parameters

    • Optionaldivisions: number

      Input number of pieces to divide the curve into. Default is 5.

    Returns AcGePoint2d[]

    Return a set of divisions + 1 equi-spaced points using getPointAt(u).

  • Return a unit vector tangent at t. If the derived curve does not implement its tangent derivation, two points a small delta apart will be used to find its gradient which seems to give a reasonable approximation.

    Parameters

    • t: number

      Input a position on the curve. Must be in the range [ 0, 1 ].

    Returns AcGePoint2d

    Return a unit vector tangent at t.

  • Return tangent at a point which is equidistant to the ends of the curve from the point given in getTangent.

    Parameters

    • u: number

      Input a position on the curve according to the arc length. Must be in the range [0, 1].

    Returns AcGePoint2d

    Return tangent at a point which is equidistant to the ends of the curve from the point given in getTangent.

  • Given u in the range (0 .. 1), returns t also in the range ( 0 .. 1 ). u and t can then be used to give you points which are equidistant from the ends of the curve, using getPoint.

    Parameters

    • u: number
    • Optionaldistance: number

    Returns number

  • How much query - onCurve points into this circular arc.

    Zero when onCurve is not an endpoint (within a relative tolerance), or when query coincides with onCurve. A positive value means query lies on this arc's interior side of onCurve — useful when two arcs share a vertex and nearest-point distances are equal.

    Parameters

    Returns number

  • Returns the nearest point on this arc (or full circle) to the given point.

    Parameters

    Returns AcGePoint2d

  • Sample this arc to a polyline whose chord height is bounded by options.

    Uses a closed-form segment count, then getPoints. A full circle with default options still uses 100 segments; a short arc uses fewer.

    Parameters

    Returns AcGePoint2d[]

  • Transforms the entity by applying the input matrix.

    Parameters

    Returns this

  • Chord height of a full circle tessellated into circleSides equal segments.

    s = r * (1 - cos(π / n)). Used as the default world-space deviation so a full circle still uses about circleSides segments.

    Parameters

    • radius: number
    • OptionalcircleSides: number

    Returns number

  • Create an arc from mathematical (unmirrored) polar angles.

    startAngle / endAngle are atan2 angles in the XY plane (0 = +X, 90° = +Y). This differs from the five-argument constructor, whose angles are mirrored when clockwise is true.

    Parameters

    • center: AcGeVector2dLike

      Input arc center

    • radius: number

      Input arc radius

    • startAngle: number

      Input start angle in radians (atan2)

    • endAngle: number

      Input end angle in radians (atan2)

    • clockwise: boolean

      Input true to sweep clockwise from start to end

    Returns AcGeCircArc2d

  • Lexicographic pick among nearest-point candidates: smaller distSq wins; on a near-tie, larger align wins.

    Parameters

    • distSq: number
    • align: number
    • bestDistSq: number
    • bestAlign: number

    Returns boolean

  • True when point lies on the circle (center, radius) within a radial tolerance (default max(1e-6, radius * 1e-5)).

    Parameters

    Returns boolean

  • Clamp a VIEWRES-like side count into the legal VPORT range.

    Parameters

    • OptionalcircleSides: number

      Raw side count; non-finite values fall back to the default

    Returns number

  • True when two circles share the same center and radius within eps (default 1e-8).

    Parameters

    Returns boolean

  • Number of equal circular-arc segments whose chord height is at most the requested deviation.

    For the default deviation this equals ceil(|sweep| / τ * circleSides), so a full circle keeps the historical 100-segment look while a short arc uses proportionally fewer evaluations.

    Parameters

    • radius: number

      Arc radius in world units

    • sweep: number

      Signed or unsigned included angle in radians

    • Optionaloptions: AcGeTessellateOptions

      Tessellation options

    Returns number

    Segment count in [minSegments, maxSegments]

  • Create the unique arc from start through through to end.

    The through point selects the major or minor sweep, including arcs greater than 180°. Return null when the points are collinear.

    Parameters

    Returns null | AcGeCircArc2d