fast_simplification.simplify_mesh#
- fast_simplification.simplify_mesh(mesh: PolyData, target_reduction: float | None = None, target_count: int | None = None, agg: float = 7.0, verbose: bool = 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 (float, default: 7.0) – Controls how aggressively to decimate the mesh. A value of
10.0will result in a fast decimation at the expense of mesh quality and shape. A value of0.0will attempt to preserve the original mesh geometry at the expense of time. Setting a low value may result in being unable to reach thetarget_reductionortarget_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_collapsesthat 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 vertexi1was collapsed into the vertexi0.- Return type:
pyvista.PolyData