- class compas.geometry.Polyline(points, **kwargs)
A polyline is a sequence of points connected by line segments.
A polyline is a piecewise linear element. It does not have an interior. It can be open or closed. It can be self-intersecting.
points (list of point) – An ordered list of points. Each consecutive pair of points forms a segment of the polyline.
>>> polyline = Polyline([[0,0,0], [1,0,0], [2,0,0], [3,0,0]]) >>> polyline.length 3.0
>>> type(polyline.points) == Point True >>> polyline.points.x 0.0
>>> type(polyline.lines) == Line True >>> polyline.lines.length 1.0
Make an independent copy of the data object.
Divide a polyline in equal segments.
divide_polyline_by_length(length[, strict, tol])
Splits a polyline in segments of a given length.
Construct a polyline from a data dict.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Determine if the polyline is closed.
Determine if the polyline is self-intersecting.
Point on the polyline at a specific normalized parameter.
Splits a polyline at corners larger than the given angle_threshold
Calculates the tangent vector of a point on a polyline
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Transform this polyline.
Returns a transformed copy of this geometry.
Validate the object's data against its data schema (self.DATASCHEMA).
Validate the object's data against its json schema (self.JSONSCHEMA).