예제 #1
0
        public void When_the_sequence_only_contains_a_single_point_the_min_and_max_points_equal_the_point()
        {
            var thePoint = new Point(1, 2, 3);

            var aabb = AxisAlignedBoundingBox.FromPoints(
                new[] { thePoint }.Single());

            Assert.Equal(thePoint, aabb.Min);
            Assert.Equal(thePoint, aabb.Max);
        }
예제 #2
0
        public void When_the_sequence_contains_more_than_a_single_point_the_Max_point_equals_the_element_wise_maximum_of_the_sequence()
        {
            var points = new[] {
                new Point(1, 2, 3),
                new Point(2, 3, 4),
                new Point(4, 5, 6),
                new Point(-1, 3, 7),
                new Point(0, 0, -10)
            };

            var aabb = AxisAlignedBoundingBox.FromPoints(points.AsEnumerable());

            Assert.Equal(new Point(4, 5, 7), aabb.Max);
        }
예제 #3
0
 public void An_exception_is_thrown_if_the_enumerable_is_empty()
 {
     Assert.Throws <InvalidOperationException>(() =>
                                               AxisAlignedBoundingBox.FromPoints(Enumerable.Empty <Point>()));
 }
예제 #4
0
 public AxisAlignedBoundingBox GetBoundingBox()
 {
     return(AxisAlignedBoundingBox.FromPoints(_a, _b, _c));
 }
예제 #5
0
 public AxisAlignedBoundingBox GetBoundingBox()
 {
     return(AxisAlignedBoundingBox.FromPoints(Vertices));
 }