Ejemplo n.º 1
0
 def test_curve_3436_3(self):
     knotvector = [0.0, 0.0, 0.0, 1.0, 1.0, 1.0]
     basis = SvNurbsBasisFunctions(knotvector)
     ts = np.array([1.61803397])
     ns = basis.derivative(2, 2, 0)(ts)
     expected = np.array([1])
     self.assert_numpy_arrays_equal(ns, expected, precision=8)
Ejemplo n.º 2
0
    def test_basis_derivative(self):
        "Test basis functions derivative"

        expected = np.array([
            0.0, 0.29085873, 0.53185596, 0.72299169, 0.86426593, 0.95567867,
            0.99722992, 0.98891967, 0.93074792, 0.82271468, 0.66481994,
            0.45706371, 0.19944598, -0.10803324, -0.46537396, -0.87257618,
            -1.32963989, -1.8365651, -2.3933518, -3.0
        ])

        functions = SvNurbsBasisFunctions(self.knotvector)
        d2s = functions.derivative(self.span, self.degree, 1)(self.ts)

        self.assert_numpy_arrays_equal(expected, d2s, precision=8)