Exemple #1
0
        public void Intersections()
        {
            var polygons =
                new List <Polygon>
            {
                new Polygon
                (
                    new []
                {
                    new Vector3(3.0, 1.0),
                    new Vector3(10.0, 1.0),
                    new Vector3(10.0, 5.0),
                    new Vector3(3.0, 5.0)
                }
                )
            };
            var inters =
                new List <Polygon>
            {
                new Polygon
                (
                    new []
                {
                    new Vector3(7.0, 0.0),
                    new Vector3(8.0, 0.0),
                    new Vector3(8.0, 7.0),
                    new Vector3(7.0, 7.0)
                }
                ),
                new Polygon
                (
                    new []
                {
                    new Vector3(1.0, 3.0),
                    new Vector3(5.0, 3.0),
                    new Vector3(5.0, 7.0),
                    new Vector3(1.0, 7.0)
                }
                )
            };
            var intersects = Shaper.Intersections(polygons, inters);

            Assert.Equal(2, intersects.Count);
        }