ProtoTwin API
    Preparing search index...

    Class Polyline

    Immutable polyline

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Constructor.

      Parameters

      • points: readonly Vec3[]

        The points that form the polyline.

      • surfaceNormals: readonly Vec3[] = []

        The (optional) surface normals for each polyline segment.

      Returns Polyline

      The surface normals are only used by transport surfaces to disambiguate the normal direction according to the surface that was selected.

    Accessors

    • get closed(): boolean

      Whether the polyline is closed.

      Returns boolean

    • get distances(): readonly number[]

      The ditances along the polyline for the end of each segment.

      Returns readonly number[]

    • get length(): number

      The length of the polyline.

      Returns number

    • get points(): readonly number[]

      The points that form the polyline.

      Returns readonly number[]

    Methods

    • Evaluates the frame at the specified distance.

      Parameters

      • s: number

        The distance.

      Returns Frame

      The frame.

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

      Parameters

      • s: number

        The distance.

      Returns Vec3

      The normal to the polyline.

      Uses the segment surface normal when one is supplied; otherwise uses an orthonormal geometric fallback.

    • Parameters

      • s: number

      Returns number

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

      Parameters

      • s: number

        The distance.

      Returns Vec3

      The point on the polyline.

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

      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 polyline at the specified distance.

      Parameters

      • s: number

        The distance.

      Returns Vec3

      The tangent to the polyline.

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

      Parameters

      • s0: number

        The start arc-length.

      • s1: number

        The end arc-length.

      Returns Polyline

      The trimmed polyline.

    • Determines whether two polylines are exactly equal.

      Parameters

      Returns boolean

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

    • Determines whether two polylines are not exactly equal.

      Parameters

      Returns boolean

      True if the two polylines are different, false otherwise.