Function GeometrySingleton.offsetPolygon2d
Inflates or deflates polygon
by delta
units (pixels). If delta
is positive, makes the polygon grow outward. If delta
is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if delta
is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon.
Each polygon's vertices will be rounded as determined by join_type
, see polyjointype
.
The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling isPolygonClockwise
.