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 = false
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 closed(): boolean
  • Return true if its start point is identical to its end point. Otherwise, return false.

    Returns boolean

  • 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 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

Methods

  • Get list of cumulative segment lengths.

    Parameters

    • divisions: number = ...

      Input number of pieces to divide the curve into.

    Returns number[]

    Return list of cumulative segment lengths.

  • 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.

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

    Parameters

    • divisions: number = 5

      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

  • 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
    • circleSides: number = AcGeCircArc2d.DEFAULT_CIRCLE_SIDES

    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

  • 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

  • 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]