copy

PolyData.copy(deep=True)

Return a copy of the object.

Parameters
deepbool, optional

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
>>> mesh_a = pyvista.Sphere()
>>> mesh_b = mesh_a.copy()
>>> mesh_a == mesh_b
True