cnr-isti-vclab / PyMeshLab

The open source mesh processing python library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error using filter: "Screened Poisson Surface Reconstruction"

ortobajt opened this issue · comments

I'm having trouble using the filter "Screened Poisson Surface Reconstruction". Below is a detailed description of the error:

  1. Run the script in python:
    import pymeshlab ms = pymeshlab.MeshSet() ms.load_new_mesh('C:\\Model3dTMP\\in0.stl') ms.load_filter_script('C:\\Model3dTMP\\PoissonSurfaceReconstruction.mlx') ms.apply_filter_script() ms.save_current_mesh('C:\\Modele3dTMP\\out.stl')

  2. My PoissonSurfaceReconstruction.mlx script looks like this (default parameter values):

<FilterScript> <filter name="Remove Duplicate Vertices"/> <xmlfilter name="Screened Poisson Surface Reconstruction"> <xmlparam value="0" name="cgDepth"/> <xmlparam value="false" name="confidence"/> <xmlparam value="8" name="depth"/> <xmlparam value="5" name="fullDepth"/> <xmlparam value="8" name="iters"/> <xmlparam value="4" name="pointWeight"/> <xmlparam value="false" name="preClean"/> <xmlparam value="1.5" name="samplesPerNode"/> <xmlparam value="1.1" name="scale"/> <xmlparam value="false" name="visibleLayer"/> </xmlfilter> <filter name="Delete Current Mesh"/> </FilterScript>

  1. My input model in attachment(in0.stl):
    in0.zip

  2. I am getting the following error:
    Traceback (most recent call last):
    File "C:\Model3dTMP\run.py", line 6, in
    ms.save_current_mesh('C:\Model3dTMP\out.stl')
    pymeshlab.pmeshlab.PyMeshLabException: MeshSet has no selected Mesh.

  3. If I edit my script PoissonSurfaceReconstruction.mlx:

<FilterScript> <xmlfilter name="Screened Poisson Surface Reconstruction"> <xmlparam value="0" name="cgDepth"/> <xmlparam value="false" name="confidence"/> <xmlparam value="8" name="depth"/> <xmlparam value="5" name="fullDepth"/> <xmlparam value="8" name="iters"/> <xmlparam value="4" name="pointWeight"/> <xmlparam value="false" name="preClean"/> <xmlparam value="1.5" name="samplesPerNode"/> <xmlparam value="1.1" name="scale"/> <xmlparam value="false" name="visibleLayer"/> </xmlfilter> </FilterScript>

  1. I get an out.stl model that is identical to the input one.

  2. If i use the same filters in meshlab i get the model i expect:

image
I have to tweak the parameters of course - here are the default values, but the filter worked.

Please, explain this situation. I will just add that I use the latest environments downloaded from official sources (python, pyMeshLab, Meshlab)

Please generate again the filter script with a recent version of MeshLab. It would be recommended to use the same version of MeshLab as the one of PyMeshLab.
Your script uses an xml filter, which is an old category of meshlab plugins that have been removed some years ago.