The class represents one 3d line geometry specified by its start point and end point.

Hierarchy

  • AcGeCurve3d
    • AcGeLine3d

Constructors

Properties

_boundingBoxNeedsUpdate: boolean

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(): AcGeBox3d
  • 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 AcGeBox3d

  • get closed(): boolean
  • Returns boolean

  • get direction(): AcGeVector3d
  • Normalized direction vector of this line

    Returns AcGeVector3d

  • get endPoint(): AcGePoint3d
  • The line's endpoint in WCS coordinates

    Returns AcGePoint3d

  • set endPoint(value: AcGeVector3dLike): void
  • End point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates of end point.

    Parameters

    Returns void

  • get length(): number
  • Returns number

  • get midPoint(): AcGePoint3d
  • The middle point of this line.

    Returns AcGePoint3d

  • get startPoint(): AcGePoint3d
  • The line's startpoint in WCS coordinates

    Returns AcGePoint3d

  • set startPoint(value: AcGeVector3dLike): void
  • Start point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates of end point.

    Parameters

    Returns void

Methods

  • Return a point at a certain position along the line. When t = 0, it returns the start point, and when t = 1 it returns the end point.

    Parameters

    • t: number

      Use values 0-1 to return a position along the line.

    • target: AcGePoint3d

      The result will be copied into this point.

    Returns AcGeVector3d

    Return a point at a certain position along the line.

  • Return a point at a certain position along the line.

    • If flag is false, use the length from start point to determinate the point
    • If flag is true, use the length from end point to determinate the point

    Parameters

    • length: number

      Use this length value to return a position along the line.

    • Optionalflag: boolean

    Returns AcGePoint3d

    Return a point at a certain position along the line.

  • Returns AcGeBox3d

  • Returns AcGeLine3d

  • Return the closets point on the line. If clampToLine is true, then the returned value will be clamped to the line segment.

    Parameters

    • point: AcGePoint3d

      Return the closest point on the line to this point.

    • clampToLine: boolean

      Whether to clamp the returned value to the line segment.

    • target: AcGePoint3d

      The result will be copied into this point.

    Returns AcGeVector3d

    Return the closets point on the line.

  • Return a point parameter based on the closest point as projected on the line segment. If clampToLine is true, then the returned value will be between 0 and 1.

    Parameters

    • point: AcGePoint3d

      Input the point for which to return a point parameter.

    • clampToLine: boolean

      Whether to clamp the result to the range [0, 1].

    Returns number

    Return a point parameter based on the closest point as projected on the line segment.

  • Parameters

    Returns this

  • Returns the delta vector of the line segment (end vector minus the start vector).

    Parameters

    • target: AcGeVector3d

      The result will be copied into this vector.

    Returns AcGeVector3d

    Return the delta vector of the line segment (end vector minus the start vector).

  • Return the Euclidean distance (straight-line distance) between the line's start and end points.

    Returns number

    Return the Euclidean distance (straight-line distance) between the line's start and end points.

  • Return the square of the Euclidean distance (straight-line distance) between the line's start and end point.

    Returns number

    Return the square of the Euclidean distance (straight-line distance) between the line's start and end point.

  • Extend this line with the specified length

    Parameters

    • length: number

      Input the length of extension

    • Optionalinversed: boolean

      Input the flag to determinate which point is used to calculate the length

      • ture: start point is used as the start point of the line extension
      • false: end point is used as the start point of the line extension

    Returns this

  • Check whether the specified point is on this line.

    Parameters

    Returns boolean

    Return true if the specified point is on this line. Otherwise, return false.

  • Finds the point on the line that is perpendicular to the given point. When you need the shortest distance between the given point and the line, perpPoint gives the point on the line that is the closest to the given point.

    Parameters

    • point: AcGePoint3d

      Input one point to calculate the point on the line that is the closest to this point

    Returns AcGePoint3d

    Return the point on the line that is the closest to the given point.

  • Parameters

    Returns this

  • Return new shape translated by given vector. Translation vector may be also defined by a pair of numbers.

    Parameters

    Returns AcGeShape3d