def save_ply(self, reconstruction, filename=None, no_cameras=False, no_points=False): """Save a reconstruction in PLY format.""" ply = io.reconstruction_to_ply(reconstruction, no_cameras, no_points) with io.open_wt(self._ply_file(filename)) as fout: fout.write(ply)
def save_ply(self, reconstruction): """Save a reconstruction in PLY format""" ply = io.reconstruction_to_ply(reconstruction) with open(self.__ply_file(), 'w') as fout: fout.write(ply)
def test_reconstruction_to_ply(): with open(filename) as fin: obj = json.loads(fin.read()) reconstructions = io.reconstructions_from_json(obj) ply = io.reconstruction_to_ply(reconstructions[0]) assert len(ply.splitlines()) > len(reconstructions[0].points)