offset_polyline

compas.geometry.offset_polyline(polyline, distance, normal=[0.0, 0.0, 1.0], tol=None)[source]

Offset a polyline by a distance.

Parameters:
polylinesequence[point] | compas.geometry.Polyline

The XYZ coordinates of the vertices of a polyline.

distancefloat | list[tuple[float, float]]

The offset distance as float. A single value determines a constant offset globally. Alternatively, pairs of local offset values per line segment can be used to create variable offsets.

normal[float, float, float] | compas.geometry.Vector, optional

The normal of the offset plane.

tolfloat, optional

A tolerance value for intersection calculations. Default is TOL.absolute.

Returns:
list[[float, float, float]]

The XYZ coordinates of the resulting polyline.

Notes

The offset direction is determined by the provided normal vector. If the polyline is in the XY plane and the normal is along the positive Z axis, positive offset distances will result in counterclockwise offsets, and negative values in clockwise direction.