The ClipperOffset class encapsulates the process of offsetting (inflating/deflating) both open and closed paths using a number of different join types and end types.
(This class replaces the now deprecated OffsetPaths function which was less flexible.)
Preconditions for offsetting:
1. The orientations of closed paths must be consistent such that outer polygons share the same orientation, and any holes have the opposite orientation (ie non-zero filling). Open paths must be oriented with closed outer polygons.
2. Polygons must not self-intersect.
When offsetting, small artefacts may appear where polygons overlap. To avoid these artefacts, offset overlapping polygons separately.
using namespace ClipperLib;
IntPoint(348,257) << IntPoint(364,148) << IntPoint(362,148) <<
IntPoint(326,241) << IntPoint(295,219) << IntPoint(258,88) <<
IntPoint(440,129) << IntPoint(370,196) << IntPoint(372,275);
co.AddPath(subj, jtRound, etClosedPolygon);
//draw solution ...
DrawPolygons(solution, 0x4000FF00, 0xFF009900);
Copyright ©2010-2014 Angus Johnson - Clipper 6.2.0 - Help file built on 16-October-2014