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.

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