merge#
- PolyDataFilters.merge(dataset, merge_points=True, inplace=False, main_has_priority=True, progress_bar=False)[source]#
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.Note
The
+
operator between two meshes uses this filter with the default parameters. When the other mesh is also apyvista.PolyData
, in-place merging via+=
is similarly possible.- Parameters:
- dataset
pyvista.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 apyvista.PolyData
. For other input meshes the result is apyvista.UnstructuredGrid
which makes in-place operation impossible.- main_has_prioritybool,
optional
When this parameter is
True
andmerge_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.
- dataset
- Returns:
pyvista.DataSet
pyvista.PolyData
ifdataset
is apyvista.PolyData
, otherwise apyvista.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')