Getting Started¶

The main class of PyMeshLab is the MeshSet class. It represents the current state of MeshLab (containing a set of meshes, rasters…). See the documentation of the MeshSet class for more details.

After installing PyMeshLab through pip:

import pymeshlab as ml
ms = ml.MeshSet()

You can load, save meshes and apply MeshLab filters:

ms.load_mesh('airplane.obj')
ms.apply_filter('convex_hull')
ms.save_mesh('convex_hull.ply')

You can list all the available filters and theirs parameters:

ms.print_filter_list()
ms.print_filter_parameter_list('surface_reconstruction_screened_poisson')

And apply filters with your parameters:

ms.apply_filter('noisy_isosurface', resolution=128)

To run the tests:

pip3 install pytest
pytest --pyargs pymeshlab