Polyline

open class Polyline(val vertices: List<FlatPoint>) : Composite

Open chain of straight edges through a sequence of vertices.

The open sibling of Polygon: N vertices make N − 1 edges, with no closing edge and no interior. Starting vertex and traversal direction are data — equals distinguishes both. The first and last vertices may coincide — a closed walk, detected at the SCALE quantum (see toPolygon); only consecutive coincident vertices are rejected.

Throws

When fewer than 2 vertices are given, a vertex lies at infinity, or two consecutive vertices coincide at the SCALE quantum.

Constructors

Link copied to clipboard
constructor(vertices: List<FlatPoint>)

Validates the vertex list and throws on degenerate input.

Properties

Link copied to clipboard

The edges, one Segment per consecutive vertex pair — N − 1 for N vertices, no wrap.

Link copied to clipboard

The closed Polygon over the same walk.

Link copied to clipboard

The points the chain passes through — finite FlatPoints in traversal order.

Functions

Link copied to clipboard
open fun copy(polyline: Polyline): Polyline

Returns this object rebuilt around the replacement geometry polyline — the hook the shape-preserving operations return through.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Rounded identity over the vertex walk: equal when the vertex lists match pairwise at the SCALE quantum.

Link copied to clipboard
open override fun hashCode(): Int

Returns the hash of the rounded vertices, consistent with equals.

Link copied to clipboard
open override fun toString(): String

Returns the vertices — raw components, full stored precision.

Link copied to clipboard

Returns the vertices rounded at the SCALE quantum — the debug-output convention of every shape.