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

Hierarchy

  • AcGeCurve3d
    • AcGeLine3d

Constructors

Properties

_boundingBoxNeedsUpdate: boolean = false

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

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.

    • flag: boolean = false

    Returns AcGePoint3d

    Return a point at a certain position along the line.

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

  • 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

    • inversed: boolean = false

      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 AcGeLine3d

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