How to manage several polydata at the same time

Hello,
I have a mesh named my_initial_mesh with, let say for the example 6 cells named [0 1 2 3 4 5]

I would like to delete 2 cells and plot the results of both at the same time
so i do :
my_troncated_mesh=my_mesh
my_troncated_mesh.DeleteCell(2)
my_troncated_mesh.DeleteCell(3)
my_troncated_mesh.RemoveDeletedCells()

and then, when i plot my_troncated_mesh i have exactly what i want, both cell 2 and cell 3 have been deleted

my problem : when i plot or print my_initial_mesh, those 2 cells are also deleted on that mesh… I would like to have my_initial_mesh with the 6 cells and my_troncated_mesh with 4 cells.

But those polydata seems liked and i do not understand why. And i think i concidare my mesh as kind of array. if write
a=[1, 2 ,3 ,4 ,5]
b=a
b.pop(2)
if I print a, i have “[1, 2 ,3 ,4 ,5]” and if i print b i have “[1, 2 ,4 ,5]”,
a and b are not linked

Thanks in advance for any help or any tips

I suppose you need to do a DeepCopy to get an actual copy - something like

my_troncated_mesh=vtkPolyData()
my_troncated_mesh.DeepCopy(my_mesh)

I don’t really know VTK’s python interface, what I show here is just cobbled together from examples I found, hope you get the gist.
At least under C++, without a DeepCopy, the internal data structures are all reused (that is, shared between the original and the copy - which would explain the behavior you see with the cells also being deleted in the original mesh).