Esempio n. 1
0
 def test_curve_tangent(self):
     geomdl_curve = SvGeomdlCurve.build(self.degree, self.knotvector,
                                        self.control_points, self.weights)
     t1s = geomdl_curve.tangent_array(self.ts)
     native_curve = SvNativeNurbsCurve(self.degree, self.knotvector,
                                       self.control_points, self.weights)
     t2s = native_curve.tangent_array(self.ts)
     self.assert_numpy_arrays_equal(t1s, t2s, precision=8)
Esempio n. 2
0
 def test_curve_eval_2(self):
     weights = [1.0, 2.0, 3.0, 1.0]
     geomdl_curve = SvGeomdlCurve.build(self.degree, self.knotvector,
                                        self.control_points, weights)
     t1s = geomdl_curve.evaluate_array(self.ts)
     native_curve = SvNativeNurbsCurve(self.degree, self.knotvector,
                                       self.control_points, weights)
     t2s = native_curve.evaluate_array(self.ts)
     self.assert_numpy_arrays_equal(t1s, t2s, precision=8)
Esempio n. 3
0
 def test_curve_3436_2(self):
     points = [(0, 0, 0), (0.5, 0, 0.5), (1, 0, 0)]
     ts = np.array([0, 0.5, 1])
     degree = 2
     knotvector = [0, 0, 0, 1, 1, 1]
     weights = [1, 1, 1]
     geomdl_curve = SvGeomdlCurve.build(degree, knotvector, points, weights)
     native_curve = SvNativeNurbsCurve(degree, knotvector, points, weights)
     p1s = geomdl_curve.third_derivative_array(ts)
     p2s = native_curve.third_derivative_array(ts)
     self.assert_numpy_arrays_equal(p1s, p2s, precision=8)