Home | ClipperLib |
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.
Limitations:
When offsetting, small artefacts may appear where polygons overlap. To avoid these artefacts, offset overlapping polygons separately.
#include "clipper.hpp" ... using namespace ClipperLib; int main() { Path subj; Paths solution; subj << 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); ClipperOffset co; co.AddPath(subj, jtRound, etClosedPolygon); co.Execute(solution, -7.0); //draw solution ... DrawPolygons(solution, 0x4000FF00, 0xFF009900); } |
Methods | Properties |
---|---|
In ClipperOffset: | |
AddPath | ArcTolerance |
AddPaths | MiterLimit |
Clear | |
Constructor | |
Execute |
Copyright ©2010-2014 Angus Johnson - Clipper 6.2.1 - Help file built on 1-November-2014