PolyData.merge(dataset, merge_points=True, inplace=False, main_has_priority=True, progress_bar=False)

Merge this mesh with one or more datasets.


The behavior of this filter varies from the PolyDataFilters.boolean_union() filter. This filter does not attempt to create a manifold mesh and will include internal surfaces when two meshes overlap.


The + operator between two meshes uses this filter with the default parameters. When the other mesh is also a pyvista.PolyData, in-place merging via += is similarly possible.


PyVista dataset to merge this mesh with.

merge_pointsbool, optional

Merge equivalent points when True.

inplacebool, optional

Updates grid inplace when True if the input type is a pyvista.PolyData. For other input meshes the result is a pyvista.UnstructuredGrid which makes in-place operation impossible.

main_has_prioritybool, optional

When this parameter is True and merge_points=True, the arrays of the merging grids will be overwritten by the original main mesh.

progress_barbool, optional

Display a progress bar to indicate progress.


pyvista.PolyData if dataset is a pyvista.PolyData, otherwise a pyvista.UnstructuredGrid.


>>> import pyvista
>>> sphere_a = pyvista.Sphere()
>>> sphere_b = pyvista.Sphere(center=(0.5, 0, 0))
>>> merged = sphere_a.merge(sphere_b)
>>> merged.plot(style='wireframe', color='tan')