-
Notifications
You must be signed in to change notification settings - Fork 18
pygeo.offset_polygon
fabian-flassig edited this page May 18, 2026
·
4 revisions
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_polygon_ex.
pygeo.offset_polygon(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. |
| Type | Description |
|---|---|
points |
{{x,y,z}, ...} |
- 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_polylineorpytha.create_polygonto produce a part.
Minimum PYTHA Version: V26
pygeo, pygeo.offset_polygon_ex, pytha.analyze_polyline, pytha.create_polyline