Abstract base class for all 2d curves. Any class that is derived from this class represents a 2d curve.

Hierarchy (View Summary)

Constructors

Properties

_boundingBoxNeedsUpdate: boolean = false
arcLengthDivisions: number

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

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

  • Return a set of divisions + 1 points using getPoint(t).

    Parameters

    • divisions: number = 5

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

    Returns AcGePoint2d[]

    Return a set of divisions + 1 points using getPoint(t)

  • 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