decimate_mesh#

ifermi.surface.decimate_mesh(vertices, faces, factor, method='quadric')[source]#

Decimate mesh to reduce the number of triangles and vertices.

The open3d package is required for decimation.

Parameters:
  • vertices (ndarray) – A (n, 3) float array of the vertices in the isosurface.

  • faces (ndarray) – A (m, 3) int array of the faces of the isosurface.

  • factor (float) – If method is “quadric”, and factor is a floating point value then factor is the scaling factor by which to reduce the number of faces. I.e., final # faces = initial # faces * factor. If method is “quadric” but factor is an integer then factor is the target number of final faces. If method is “cluster”, factor is the voxel size in which to cluster points.

  • method – Algorithm to use for decimation. Options are “quadric” or “cluster”.

Returns:

(vertices, faces) of the decimated mesh.