offset_polyline

compas.geometry.offset_polyline(polyline, distance, normal=[0.0, 0.0, 1.0], tol=1e-06)[source]

Offset a polyline by a distance.

Parameters
  • polyline (sequence[point] | Polyline) – The XYZ coordinates of the vertices of a polyline.

  • distance (float | 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] | Vector, optional) – The normal of the offset plane.

  • tol (float, optional) – A tolerance value for intersection calculations.

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.

Examples

>>>