Esempio n. 1
0
        public void NonIntersecting()
        {
            var polygon =
                new Polygon
                (
                    new[]
            {
                Vector3.Origin,
                new Vector3(8.0, 0.0),
                new Vector3(8.0, 3.0),
                new Vector3(0.0, 3.0)
            }
                );
            var nearPolygon =
                new Polygon
                (
                    new[]
            {
                new Vector3(5.0, 0.0),
                new Vector3(8.0, 0.0),
                new Vector3(8.0, 20.0),
                new Vector3(5.0, 20.0)
            }
                );
            var polygons = Shaper.NearPolygons(polygon, nearPolygon, true);

            polygons = Shaper.NonIntersecting(polygon.ToList(), polygons);
            Assert.Equal(24, polygons.Count);
        }
Esempio n. 2
0
        public void NearPolygons()
        {
            var polygon =
                new Polygon
                (
                    new[]
            {
                Vector3.Origin,
                new Vector3(8.0, 0.0),
                new Vector3(8.0, 3.0),
                new Vector3(0.0, 3.0)
            }
                );
            var nearPolygon =
                new Polygon
                (
                    new[]
            {
                new Vector3(5.0, 0.0),
                new Vector3(8.0, 0.0),
                new Vector3(8.0, 20.0),
                new Vector3(5.0, 20.0)
            }
                );
            var polygons = Shaper.NearPolygons(polygon, nearPolygon, true);

            Assert.Equal(32, polygons.Count);
        }