예제 #1
0
        public void It_Creates_A_Copy_Of_The_Knot_Vector()
        {
            // Assert
            KnotVector knotVector = new KnotVector {
                0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 3.3, 4, 4, 4
            };

            // Act
            KnotVector knotVectorCopy = knotVector.Copy();

            // Arrange
            knotVectorCopy.Should().NotBeSameAs(knotVector);
            knotVectorCopy.Should().BeEquivalentTo(knotVector);
        }
예제 #2
0
        public void It_Creates_An_Unclamped_Uniform_KnotVector()
        {
            // Arrange
            int        degree             = 3;
            int        ctrlPts            = 5;
            KnotVector expectedKnotVector = new KnotVector {
                0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0
            };

            // Act
            KnotVector knots = new KnotVector(degree, ctrlPts, false);

            // Assert
            knots.Should().BeEquivalentTo(expectedKnotVector);
        }
예제 #3
0
        public void It_Reverses_A_Knot_Vectors()
        {
            // Assert
            KnotVector knotVector = new KnotVector {
                0, 0, 0, 0, 1, 1, 2, 2, 2, 3, 3.3, 4, 4, 4
            };
            KnotVector expectedKnotVector = new KnotVector {
                0, 0, 0, 0.7000000000000002, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4
            };

            // Act
            KnotVector reversedKnots = KnotVector.Reverse(knotVector);

            // Arrange
            reversedKnots.Should().BeEquivalentTo(expectedKnotVector);
        }
예제 #4
0
        public void It_Returns_A_Normalized_Knot_Vector()
        {
            // Arrange
            KnotVector knots = new KnotVector {
                -5, -5, -3, -2, 2, 3, 5, 5
            };
            KnotVector knotsExpected = new KnotVector {
                0.0, 0.0, 0.2, 0.3, 0.7, 0.8, 1.0, 1.0
            };

            // Act
            KnotVector normalizedKnots = knots.Normalize();

            // Assert
            normalizedKnots.Should().BeEquivalentTo(knotsExpected);
        }