Esempio n. 1
0
 def test_eval(self):
     geomdl_surface = SvGeomdlSurface.build_geomdl(
         self.degree_u, self.degree_v, self.knotvector_u, self.knotvector_v,
         self.control_points, self.weights)
     native_surface = SvNativeNurbsSurface(self.degree_u, self.degree_v,
                                           self.knotvector_u,
                                           self.knotvector_v,
                                           self.control_points,
                                           self.weights)
     vs1 = geomdl_surface.evaluate_array(self.us, self.vs)
     vs2 = native_surface.evaluate_array(self.us, self.vs)
     self.assert_numpy_arrays_equal(vs1, vs2, precision=8)
Esempio n. 2
0
    def test_eval_2(self):
        weights = [[1, 1, 1, 1], [1, 2, 3, 1], [1, 3, 4, 1], [1, 4, 5, 1],
                   [1, 1, 1, 1]]

        geomdl_surface = SvGeomdlSurface.build_geomdl(
            self.degree_u, self.degree_v, self.knotvector_u, self.knotvector_v,
            self.control_points, weights)
        native_surface = SvNativeNurbsSurface(self.degree_u, self.degree_v,
                                              self.knotvector_u,
                                              self.knotvector_v,
                                              self.control_points, weights)
        vs1 = geomdl_surface.evaluate_array(self.us, self.vs)
        vs2 = native_surface.evaluate_array(self.us, self.vs)
        self.assert_numpy_arrays_equal(vs1, vs2, precision=8, fail_fast=False)