OffsetPolygons

Del.» function OffsetPolygons(const polys: TPolygons; const delta: double; JoinType: TJoinType = jtSquare; Limit: double = 0.0; AutoFix: boolean = true): TPolygons;

C++ » void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys, double delta, JoinType jointype = jtSquare, double limit = 0.0, bool autoFix = true);

C#  » public static Polygons OffsetPolygons(Polygons polys, double delta, JoinType jointype = JoinType.jtSquare, double limit = 0.0, bool autoFix = true);


This function offsets the 'polys' polygons parameter by the 'delta' amount. Positive delta values expand outer polygons and contract inner 'hole' polygons. Negative deltas do the reverse.


Edge joins may be one of three jointypes - jtMiter, jtSquare or jtRound. (See the image below for examples.)

The meaning and use of the limit parameter depends on joinType:


It's important that the polygons passed to this function are oriented such that outer polygons have a 'true' orientation and inner 'hole' polygons have a 'false' orientation. If the orientations of input polygons are incorrect, the function will return unexpected results.

The optional autoFix parameter will check the orientations of the input polygons and reverse them if needed. (AutoFix is optional because it is time-consuming. If the orientations of the input polygons are known to be correct and duplicate vertices don't need stripping, then set this parameter to false.)



See Also

Orientation, JoinType