pyvista.DataObject.copy

pyvista.DataObject.copy#

DataObject.copy(deep: bool = True) Self[source]#

Return a copy of the object.

Parameters:
deepbool, default: True

When True makes a full copy of the object. When False, performs a shallow copy where the points, cell, and data arrays are references to the original object.

Returns:
pyvista.DataSet

Deep or shallow copy of the input. Type is identical to the input.

Examples

Create and make a deep copy of a PolyData object.

>>> import pyvista as pv
>>> mesh_a = pv.Sphere()
>>> mesh_b = mesh_a.copy()
>>> mesh_a == mesh_b
True