XOR

Delphifunction Xor(const subjects, clips: TPaths64; fillRule: TFillRule): TPaths64;

Delphifunction Xor(const subjects, clips: TPathsD; fillRule: TFillRule; decimalPrec: integer): TPathsD;


C++Paths64 Xor(const Paths64& subjects, const Paths64& clips, FillRule fillrule);

C++PathsD Xor(const PathsD& subjects, const PathsD& clips, FillRule fillrule, int decimalPrec);


C# public static Paths64 Xor(Paths64 subject, Paths64 clip, FillRule fillRule);

C# public static PathsD Xor(PathsD subject, PathsD clip, FillRule fillRule, int decimalPrec);


This function 'XORs' closed subject paths and clip paths. However, with more complex clipping operations (eg when clipping open paths), you'll need to use the Clipper64 or ClipperD classes directly.

When using floating point types, the precision parameter indicated the desired coordinate precision (up to 8 decimal places).

C++ Example:
  Paths64 subject, clip, solution;
  subject.push_back(MakePath({100, 50, 10, 79, 65, 2, 65, 98, 10, 21}));
  clip.push_back(MakePath({98, 63, 4, 68, 77, 8, 52, 100, 19, 12}));
  solution = Xor(subject, clip, FillRule::NonZero);  
  //draw solution

      

C# Example:
  Paths64 subj = new Paths64();
  Paths64 clip = new Paths64();
  subj.Add(Clipper.MakePath(new int[] { 100, 50, 10, 79, 65, 2, 65, 98, 10, 21 }));
  clip.Add(Clipper.MakePath(new int[] { 98, 63, 4, 68, 77, 8, 52, 100, 19, 12 }));
  Paths64 solution = Clipper.Xor(subj, clip, FillRule.NonZero);
  //draw solution

      

  

See Also

Overview, Clipper64, ClipperD, ClipType, FillRule