offset¶
- opstool.pre.section.offset(points, d)[source]¶
Offsets closed polygons.
Parameters¶
- pointslist[list[float, float]]
A list containing the coordinate points, [(x1, y1),(x2, y2),…,(xn.yn)].
- dfloat
Offsets closed polygons, positive values offset inwards, negative values outwards.
Returns¶
coords: list[[float, float]], new offset points.
Examples¶
>>> import opstool as opst >>> outlines1 = [[0, 0], [0, 1], [1, 1]] >>> outlines2 = opst.pre.section.offset(outlines1, d=0.1) >>> outlines3 = [[0, 0], [0, 1], [1, 1], [1, 0]] >>> outlines4 = opst.pre.section.offset(outlines3, d=0.1)