def test_vertex_to_vertex(self): mesh = generate_box_mesh(np.zeros(3), np.ones(3)) mesh.add_attribute("vertex_normal") vertex_normals = mesh.get_vertex_attribute("vertex_normal") vertex_normals2 = convert_to_vertex_attribute(mesh, vertex_normals.ravel()) self.assert_array_equal(vertex_normals.ravel(), vertex_normals2.ravel())
def test_vertex_to_vertex(self): mesh = generate_box_mesh(np.zeros(3), np.ones(3)); mesh.add_attribute("vertex_normal"); vertex_normals = mesh.get_vertex_attribute("vertex_normal"); vertex_normals2 = convert_to_vertex_attribute( mesh, vertex_normals.ravel()); self.assert_array_equal( vertex_normals.ravel(), vertex_normals2.ravel());
def test_face_to_vertex(self): mesh = generate_box_mesh(np.zeros(3), np.ones(3)) attr = np.ones(mesh.num_faces) attr2 = convert_to_vertex_attribute(mesh, attr).ravel() self.assert_array_equal(np.ones(mesh.num_vertices), attr2)
def test_face_to_vertex(self): mesh = generate_box_mesh(np.zeros(3), np.ones(3)); attr = np.ones(mesh.num_faces); attr2 = convert_to_vertex_attribute(mesh, attr).ravel(); self.assert_array_equal(np.ones(mesh.num_vertices), attr2);