Defines a connected sequence of line segments created as a single object.
A polyline is a line consisting of one or more line segments joined end to end. Polylines, unlike polygons, are not necessarily closed.
new Polyline2d(
points?):Polyline2d
Creates a polyline from points.
Copies of the provided points are stored in the polyline.
Point2d[] = []
Polyline points.
Polyline2d
readonlypoints:Point2d[]
Points composing the polyline.
get id():
bigint
Returns the unique identifier of the object.
bigint
get numberOfPoints():
number
Returns the number of points in the polyline.
Use Polyline2d.points and points.length instead.
number
addPoint(
point):void
Adds a copy of the point to the end of the polyline.
Point to copy and add.
void
Use Polyline2d.points and points.push(point.clone()) instead.
addPoints(
points):void
Adds copies of the points to the end of the polyline.
Point2d[]
Points to copy and add.
void
Use Polyline2d.points and points.push(...addedPoints.map((point) => point.clone())) instead.
point(
index):Point2d
Returns the point at position index in the polyline.
Throws a RangeError if index is not in the range [0, numberOfPoints - 1].
number
Point index.
Use Polyline2d.points and points[index] instead.