public static Shape2 CutOutside(this Shape2 shape, Polygon polygon) { var ss = shape.ToSuperShape(); ss.Cut(polygon, false); return(ss.ToShape()); }
public static Shape2 Pave(Polygon polygon, Shape2 carpet, bool inside = true) { var super = carpet.ToSuperShape(); super.Cut(polygon, inside); return(super.ToShape()); }
public static Shape2 PaveExact(Polygon polygon, Shape2 carpet, bool inside = true) { var super = carpet.ToSuperShape(); super.Cut(polygon, inside); var cutPolygon = super.FindPolygon(!inside, polygon[0]); if (inside) { return(polygon.PutInside(cutPolygon).Fill().Join(super.ToShape()).Normalize()); } else { return(cutPolygon.PutInside(polygon).Fill()); //.Join(super.ToShape()).Normalize(); } }