daavoo / pyntcloud

pyntcloud is a Python library for working with 3D point clouds.
http://pyntcloud.readthedocs.io
MIT License
1.39k stars 221 forks source link

Header / comments Editing #272

Closed cell-a closed 3 years ago

cell-a commented 4 years ago

Hello @daavoo i need to edit existing ply file contain header (text) & binary without effecting the binary i want to replace in comments or in the header i'm tried to use edit_ply from this code Read & Write Ply File but its didn't work i have paths in the comments and i need to edit this paths also i'm tried to use normal code (re , str.replace) but its make error in encoding please support

daavoo commented 3 years ago

Hola @cell-a I think that you can now do what you needed installing pyntcloud from the current master branch:

cloud = PyntCloud.from_file("examples/data/ankylosaurus_mesh.ply")
print(cloud.comments)
cloud.comments = ["new_path_0", "new_path_1"]
cloud.to_file("ankylosaurus_mesh_with_new_paths.ply", also_save=["mesh", "comments"])

Feel free to re-open or comment if your issue still persist