public void Filtering_a_list_of_intersections(CsgOperation operation, int index1, int index2) { var s1 = Sphere.UnitSphere(); var s2 = new Cube(); var csg = new Csg(operation, s1, s2); var xs = IntersectionCollection.Create((1, s1), (2, s2), (3, s1), (4, s2)); var result = csg.FilterIntersections(xs); result.Intersections.Should().HaveCount(2); result[0].Should().Be(xs[index1]); result[1].Should().Be(xs[index2]); }
public void FilterListOfIntersections( Operation op, int x0, int x1) { var s1 = new Sphere(); var s2 = new Cube(); var csg = new Csg(op, s1, s2); var xs = IntersectionList.Create( new Intersection(1, s1), new Intersection(2, s2), new Intersection(3, s1), new Intersection(4, s2)); var result = csg.FilterIntersections(xs); Assert.Equal(2, result.Count); Assert.Equal(xs[x0], result[0]); Assert.Equal(xs[x1], result[1]); }