merge

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

Merge this mesh with one or more datasets.

Note

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.

Parameters
datasetpyvista.DataSet

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.UnstructuredGrid.

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.

Returns
pyvista.DataSet

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

Examples

>>> 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')
../../../_images/pyvista-PolyDataFilters-merge-1_00_00.png