Esempio n. 1
0
        public static Shape2 CutOutside(this Shape2 shape, Polygon polygon)
        {
            var ss = shape.ToSuperShape();

            ss.Cut(polygon, false);
            return(ss.ToShape());
        }
Esempio n. 2
0
        public static Shape2 Pave(Polygon polygon, Shape2 carpet, bool inside = true)
        {
            var super = carpet.ToSuperShape();

            super.Cut(polygon, inside);

            return(super.ToShape());
        }
Esempio n. 3
0
        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();
            }
        }