The class represents the polyline geometry.

Type Parameters

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

  • set closed(value: boolean): void
  • Set the polyline to be closed (that is, there is a segment drawn from the last vertex to the first) if 'value' is true. Set the polyline to be open (no segment between the last and first vertices) if 'value' is false.

    Parameters

    • value: boolean

    Returns void

Methods

  • This function adds a vertex to the polyline. If index is 0, the vertex will become the first vertex of the polyline. If index is the value returned by this.numberOfVertices, then the vertex will become the last vertex of the polyline. Otherwise the vertex will be added just before the index vertex.

    Parameters

    • index: number

      Input index (0 based) before which to insert the vertex

    • vertex: T

      Input vertex location point

    Returns void

  • 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 an array of points to draw this polyline.

    Parameters

    • numPoints: number

      Input the nubmer of points returned for arc segmentation

    • elevation: number

      Input z value of points returned

    Returns AcGePoint3d[]

    Return an array of point

  • 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