The class represents the polyline geometry.

Type Parameters

Hierarchy (View Summary)

Constructors

Properties

_boundingBoxNeedsUpdate: boolean
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

  • get endPoint(): AcGePoint2d
  • End point of this polyline

    Returns AcGePoint2d

  • get length(): number
  • Length of this curve.

    Returns number

  • get numberOfVertices(): number
  • The number of vertices in the polyline

    Returns number

  • get startPoint(): AcGePoint2d
  • Start point of this polyline

    Returns AcGePoint2d

  • get vertices(): T[]
  • Vertices in the polyline.

    Notes: This property is exposed so that it is easier to iterate each vertex in this polyline. Please do not add or remove vertex through this property.

    Returns T[]

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

  • Get the 2d location of the vertex index in the polyline's own object coordinate system (OCS).

    Parameters

    • index: number

      Input index (0 based) of the vertex

    Returns AcGePoint2d

  • Return an array of points to draw this polyline.

    Parameters

    • numPoints: number

      Input the nubmer of points returned for arc segmentation

    Returns AcGePoint2d[]

    Return an array of point

  • 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

    • 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

  • This function removes a vertex from the polyline at the specified index.

    Parameters

    • index: number

      Input index (0 based) of the vertex to remove

    Returns void

    Error if the index is out of bounds

  • This function resets the polyline by optionally retaining some vertices. If reuse is true, the numVerts number of vertices are left intact and all vertices beyond that number are deleted. If reuse is false, numVerts is ignored and all existing vertex information will be deleted.

    Parameters

    • reuse: boolean

      Input boolean indicating whether or not to retain some vertices

    • OptionalnumVerts: number

      Input number of vertices to retain (only used when reuse is true)

    Returns void

  • Transforms the entity by applying the input matrix.

    Parameters

    Returns this