def test_writing_binary_ply_locally_using_serializer(self): local_file = os.path.join( self.tmp_dir, "test_writing_binary_ply_locally_using_serializer.ply") m = Mesh(filename=self.test_ply_path) ply.dump(m, local_file) self.assertFilesEqual(local_file, self.test_bin_ply_path)
def test_writing_ply_with_no_comments_does_not_write_comments(self): local_file = os.path.join( self.tmp_dir, "test_writing_ply_with_no_comments_does_not_write_comments.ply") m = ply.load(self.test_ply_path) ply.dump(m, local_file, ascii=True) with open(local_file) as f: self.assertNotRegexpMatches(f.read(), '\ncomment')
def write_ply(self, filename, flip_faces=False, ascii=False, little_endian=True, comments=[]): from lace.serialization import ply ply.dump(self, filename, flip_faces=flip_faces, ascii=ascii, little_endian=little_endian, comments=comments)
def test_writing_ply_with_comments_does_write_comments(self): local_file = os.path.join( self.tmp_dir, "test_writing_ply_with_comments_does_write_comments.ply") m = ply.load(self.test_ply_path) ply.dump(m, local_file, ascii=True, comments=['foo bar', 'this is a comment']) with open(local_file) as f: contents = f.read() self.assertRegexpMatches( contents, '\ncomment foo bar\ncomment this is a comment\n') self.assertNotRegexpMatches(contents, '\ncomment Copyright')