fast_simplification.simplify_mesh#
- fast_simplification.simplify_mesh(mesh, target_reduction=None, target_count=None, agg=7, verbose=False)#
Simplify a pyvista mesh.
- Parameters:
mesh (pyvista.PolyData) – PyVista mesh.
target_reduction (float) – Fraction of the original mesh to remove. If set to
0.9
, this function will try to reduce the data set to 10% of its original size and will remove 90% of the input triangles. Use this parameter ortarget_count
.target_count (int, optional) – Target number of triangles to reduce mesh to. This may be used in place of
target_reduction
, but both cannot be set.agg (int, optional) – Controls how aggressively to decimate the mesh. A value of 10 will result in a fast decimation at the expense of mesh quality and shape. A value of 0 will attempt to preserve the original mesh geometry at the expense of time. Setting a low value may result in being unable to reach the
target_reduction
ortarget_count
.verbose (bool, optional) – Enable verbose output when simplifying the mesh.
- Returns:
Simplified mesh. The field data of the mesh will contain a field named
fast_simplification_collapses
that contains the history of collapses as a(n_collapses, 2)
array of indices.collapses[i] = [i0, i1]
means that during the i-th collapse, the vertexi1
was collapsed into the vertexi0
.- Return type:
pyvista.PolyData