ProtoTwin API
    Preparing search index...

    Class Line

    Immutable line segment.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Constructor.

      Parameters

      • origin: Vec3

        The origin.

      • direction: Vec3

        The direction.

      • length: number

        The length.

      • surfaceNormal: Vec3 = Vec3.zero

        The (optional) surface normal.

      Returns Line

    Properties

    direction: Vec3

    The direction of the line segment.

    length: number

    The length of the line segment.

    origin: Vec3

    The origin of the line segment.

    surfaceNormal: Vec3

    The surface normal of the line segment.

    Used to orient the frame and to disambiguate the normal direction for transport surfaces.

    Accessors

    • get closed(): boolean

      Whether the curve is closed.

      Returns boolean

    Methods

    • Evaluates the frame at the specified distance.

      Parameters

      • s: number

        The distance.

      Returns Frame

      The frame.

    • Evaluates the normal to the line at the specified distance.

      Parameters

      • s: number

        The distance.

      Returns Vec3

      The normal to the line.

    • Parameters

      • s: number

      Returns number

    • Evaluates the point on the line at the specified distance.

      Parameters

      • s: number

        The distance.

      Returns Vec3

      The point on the line.

    • Calculates the distance for the specified point when projected onto the line.

      Parameters

      Returns number

      The distance (arc-length) for the projected point.

    • Parameters

      • s: number
      • distances: readonly number[]

      Returns number

    • Parameters

      • s: number
      • distances: readonly number[]

      Returns number

    • Evaluates the tangent to the line at the specified distance.

      Parameters

      • s: number

        The distance.

      Returns Vec3

      The tangent to the line.

    • Returns the portion of the line between two arc-length distances.

      Parameters

      • s0: number

        The start arc-length.

      • s1: number

        The end arc-length.

      Returns Line

      The trimmed line.

    • Determines whether two lines are exactly equal.

      Parameters

      • lhs: Line

        The first line.

      • rhs: Line

        The second line.

      Returns boolean

      True if the two lines are exactly equal, false otherwise.

    • Determines whether two lines are not exactly equal.

      Parameters

      • lhs: Line

        The first line.

      • rhs: Line

        The second line.

      Returns boolean

      True if the two lines are different, false otherwise.