Skip to content

ClipperOffset Execute

Seth Hillbrand edited this page Oct 29, 2026 · 2 revisions

Home › clipper.offset.h › ClipperOffset › ClipperOffset.Execute

ClipperOffset.Execute

void Execute(double delta, Paths64& paths);
void Execute(double delta, PolyTree64& polytree);

With closed paths (polygons), a positive delta specifies how much outer polygon contours will expand and how much inner "hole" contours will contract (and the converse with negative deltas).

With open paths (polylines) including EndType::Joined, delta specifies the width of the inflated line.

Execute can also be called multiple times (using different deltas).

#include "clipper2/clipper.h"  
...
using namespace Clipper2Lib;

int main()
{
  Paths64 subjects, solution;
  subjects.push_back(MakePath({100,100, 1500,100, 100,1500, 1500,1500}));
  ClipperOffset co;
  co.AddPaths(subjects, JoinType::Miter, EndType::Square);
  co.Execute(200, solution);
  //draw polyline and inflated solution
}

#include "clipper2/clipper.h"  
...
using namespace Clipper2Lib;

int main()
{
  Paths64 subjects, solution;
  // add outer polygon contour
  subjects.push_back(Ellipse(Rect64(100, 100, 1500, 1500)));
  // add inner "hole" contour (note reversed orientation)
  subjects.push_back(Ellipse(Rect64(400, 400, 1200, 1200)));
  std::reverse(subjects[0].begin(), subjects[0].end());
  ClipperOffset co;
  co.AddPaths(subjects, JoinType::Round, EndType::Polygon);
  co.Execute(100, solution);
  //draw polygon and inflated solution
}

See Also

InflatePaths, EndType

Clone this wiki locally