DataSet.copy_from#
- DataSet.copy_from(mesh: _vtk.vtkDataSet, deep: bool = True) None[source]#
Overwrite this dataset inplace with the new dataset’s geometries and data.
- Parameters:
- meshvtkDataSet
The overwriting mesh.
- deepbool, default:
True Whether to perform a deep or shallow copy.
Examples#
Download Python source code | Download Jupyter notebook
Create two meshes and overwrite mesh_a with mesh_b.
Show that mesh_a is equal to mesh_b.
>>> import pyvista as pv
>>> mesh_a = pv.Sphere()
>>> mesh_b = pv.Cube()
>>> mesh_a.copy_from(mesh_b)
>>> mesh_a == mesh_b
True