Skip to content

pygeo.offset_polyline

fabian-flassig edited this page May 21, 2026 · 1 revision

Offsets a polyline chain by a given distance and returns the result as a point list.

This function is located in the pygeo module.

The input chain may consist of line and arc segments; arcs are detected automatically from the input points using PYTHA's 2D analysis settings. The offset operation is carried out in the local plane of the chain. The returned result is a flat list of 3D points only — arc information is not preserved. If you need an offset chain with reconstructed arc segments, use pygeo.offset_polyline_ex.

pygeo.offset_polyline(chain, offset [,corner_type [,corner_angle]])
Parameter Type Description
chain {type, points} Input chain. type is "open" or "closed". points is {{x,y,z}, ...}. The format matches the return value of pytha.analyze_polyline.
offset number Offset distance. For closed chains the sign is interpreted such that a positive offset moves the contour outward.
corner_type string Optional: "sharp" (default), "rounded", or "chamfer". Controls how convex corners between segments are treated.
corner_angle number Optional: angle threshold in degrees that controls when the corner treatment is applied. Defaults to 0.

Return value

Type Description
points {{x,y,z}, ...}

Notes:

  • Arc segments are detected from the input point sequence using the 2D analysis tolerance and angle settings of PYTHA.
  • The chain is processed in its local plane; the returned points lie in that same plane.
  • For a closed chain the first point is not repeated at the end.
  • This function does not create any PYTHA geometry; the returned points can be passed to pytha.create_polyline or pytha.create_polygon to produce a part.

Version Support:

Minimum PYTHA Version: V26

See also:

pygeo, pygeo.offset_polyline_ex, pytha.analyze_polyline, pytha.create_polyline

Clone this wiki locally