Polyline.split

Polyline.split(num_segments)[source]

Split a polyline in equal segments.

Parameters:
num_segmentsint
Returns:
list

list[compas.geometry.Polyline]

Examples

>>> from compas.geometry import Polyline
>>> polyline = Polyline([(0, 0, 0), (1, 1, 0), (2, 3, 0), (4, 4, 0), (5, 2, 0)])
>>> split_polylines = polyline.split_polyline(3)
>>> split_polylines
[Polyline([Point(0.000, 0.000, 0.000), Point(1.000, 1.000, 0.000), Point(1.578, 2.157, 0.000)]),        Polyline([Point(1.578, 2.157, 0.000), Point(2.000, 3.000, 0.000), Point(3.578, 3.789, 0.000)]),        Polyline([Point(3.578, 3.789, 0.000), Point(4.000, 4.000, 0.000), Point(5.000, 2.000, 0.000)])]