pyvista.plotting.volume.Volume.copy

Contents

pyvista.plotting.volume.Volume.copy#

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

Create a copy of this volume.

Parameters:
deepbool, default: True

Create a shallow or deep copy of the volume. A deep copy will have a new property and mapper, while a shallow copy will use the mapper and property of this volume.

Returns:
Volume

Deep or shallow copy of this volume.

Examples

Create a volume of by adding it to a Plotter and then copy the volume.

>>> import pyvista as pv
>>> mesh = pv.Wavelet()
>>> pl = pv.Plotter()
>>> volume = pl.add_volume(mesh, diffuse=0.5)
>>> new_volume = volume.copy()

Change the copy’s properties. A deep copy is made by default, so the original volume is not affected.

>>> new_volume.prop.diffuse = 1.0
>>> new_volume.prop.diffuse
1.0
>>> volume.prop.diffuse
0.5
../../../_images/pyvista-plotting-volume-Volume-copy-1_00_00.png