pymeshfix.clean_from_arrays(v, f, verbose=False, joincomp=False, remove_smallest_components=True)#

Perform default cleaning procedure on vertex and face arrays.

Returns cleaned vertex and face arrays

  • v (numpy.ndarray) – Numpy n x 3 array of vertices

  • f (numpy.ndarray) – Numpy n x 3 array of faces.

  • verbose (bool, optional) – Prints progress to stdout. Default True.

  • joincomp (bool, optional) – Attempts to join nearby open components. Default False.

  • remove_smallest_components (bool, optional) – Remove all but the largest isolated component from the mesh before beginning the repair process. Default True.


  • numpy.ndarray – Points array.

  • numpy.ndarray – Faces array.


>>> import pymeshfix
>>> import numpy as np
>>> points = np.load('points.npy')
>>> faces = np.load('faces.npy')
>>> clean_points, clean_faces = pymeshfix.clean_from_arrays(points, faces)