offset_line

compas.geometry.offset_line(line, distance, normal=[0.0, 0.0, 1.0])[source]

Offset a line by a distance.

Parameters
  • line ([point, point] | compas.geometry.Line) – A line defined by two points.

  • distances (float or list[float]) – The offset distance as float. A single value determines a constant offset. A list of two offset values can be used to a create variable offset at the start and end.

  • normal ([float, float, float] | compas.geometry.Vector, optional) – The normal of the offset plane.

Returns

tuple[[float, float, float], [float, float, float]] – Two points defining the offset line.

Notes

The offset direction is chosen such that if the line were along the positve X axis and the normal of the offset plane is along the positive Z axis, the offset line is in the direction of the postive Y axis.

Examples

>>>