// perform xor public static Paths ClipperXor(this Polygon clip, Polygon subject) { var subj = new Paths(); subj.Add(subject.ToClipperPath()); var clp = new Paths(); clp.Add(clip.ToClipperPath()); var result = new Paths(); var c = new Clipper(); c.Execute(ClipType.ctXor, result, PolyFillType.pftPositive, PolyFillType.pftPositive); return result; }
public static bool IsOutside(this Vector2 point, Polygon poly) { var p = new IntPoint(point.X, point.Y); return Clipper.PointInPolygon(p, poly.ToClipperPath()) != 1; }