Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.ply export works in meshlab, but fails in PyMeshLab (with identical steps and data) #28

Closed
KeithT opened this issue Dec 10, 2020 · 2 comments

Comments

@KeithT
Copy link

KeithT commented Dec 10, 2020

The steps in MeshLab:
File->Import Test0001.asc
Filters->Normals, Curv....->Compuete normals for points sets (with default settings)
Filters ->Remeshing..->Surface Reconstruction Screen Poisson (with default settings)
File - Export Mesh Test0001.ply
Generates a .ply without issues.

Doing the same from PyMeshLab by saving the filter script and then running the following python code generates a .ply that can't be opened. Meshlab reports. "Bad vertex index in face"

ms = ml.MeshSet()
ms.set_versbosity(True)
ms.load_new_mesh(filename)
ms.load_filter_script('D:\MeshLab\PointsToMesh.mlx')
ms.apply_filter_script()
tempMeshName = filename[-12:]
newMeshName = tempMeshName[0:8]
newPath = path + newMeshName + '.ply'
ms.save_current_mesh(newPath)

.asc and .mlx in attached .zip

test0001.zip

(It's great to be able to access meshlab from python, thank you for this 🥇

@alemuntoni
Copy link
Member

Hi @KeithT, thanks for reporting this!
We are aware of this issue: it is actually related to the double precision version of meshlab.
It should be already solved (see cnr-isti-vclab/meshlab#859 and cnr-isti-vclab/meshlab#860), but I'll check if there are still other issues.
The fix will be available in the next pymeshlab release, but in the meantime a workaround is to save the ply file without binary encoding:

ms.save_current_mesh(newPath, binary=False)

(Thanks for the feedback, very appreciated! :) )

@KeithT
Copy link
Author

KeithT commented Dec 11, 2020

Great, thanks for the workaround, that worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants