ClipperOffset


Geometric offsetting refers to the process of creating parallel curves that are offset a specified distance from their primary curves.

The ClipperOffset class manages the process of offsetting (inflating/deflating) both open and closed paths using a number of different join types and end types. The library user will rarely need to access this unit directly since it will generally be easier to use the InflatePaths function when doing polygon offsetting.

Caution: Offsetting self-intersecting polygons may produce unexpected results.

Note: When inflating polygons, it's important that you select EndType.Polygon. If you select one of the open path end types instead (including EndType.Join), you'll simply inflate the polygon's outline. (Example here.)

C++ Example:
#include "clipper.h"  
...
using namespace Clipper2Lib;

int main()
{
  Paths64 subj;
  subj.push_back(MakePath("348,257  364,148  362,148  \
    326,241  295,219  258,88  440,129  370,196  372,275"));

  Paths64 solution = InflatePaths(subj, -7, 
    JoinType::Round, EndType::Polygon);
      
  //draw solution ...
  DrawPolygons(solution, 0x4000FF00, 0xFF009900);
}
      

Reference

Functions Properties
In ClipperOffset:
AddPath ArcTolerance
AddPaths MiterLimit
Clear ReverseSolution
Constructor
Execute

See Also

InflatePaths