DataSetFilters.merge_points

DataSetFilters.merge_points#

DataSetFilters.merge_points(
*,
tolerance: float = 0.0,
inplace: bool = False,
progress_bar: bool = False,
) → _OutputDataSet[source]#

Merge duplicate points in this mesh.

Added in version 0.45.

Parameters:
tolerancefloat, optional

Specify a tolerance to use when comparing points. Points within this tolerance will be merged.

inplacebool, default: False

Overwrite the original mesh with the result. Only possible if the input is PolyData or UnstructuredGrid.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
outputpyvista.PolyData | pyvista.PointSet | pyvista.UnstructuredGrid

Mesh with merged points. A PolyData gives a PolyData and a PointSet a PointSet; every other dataset gives an UnstructuredGrid.

Examples#

Download Python source code | Download Jupyter notebook

Merge duplicate points in a mesh.

>>> import pyvista as pv
>>> mesh = pv.Cylinder(resolution=4)
>>> mesh.n_points
16
>>> _ = mesh.merge_points(inplace=True)
>>> mesh.n_points
8