From 6a2acca9a81d6e2ee650a39e026293d2452f6d98 Mon Sep 17 00:00:00 2001 From: marcomusy Date: Fri, 1 Mar 2024 22:17:24 +0100 Subject: [PATCH] remove self.__class__(kpoly) --- vedo/pointcloud.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/vedo/pointcloud.py b/vedo/pointcloud.py index 09b7743e..05356b43 100644 --- a/vedo/pointcloud.py +++ b/vedo/pointcloud.py @@ -856,11 +856,12 @@ def clone(self, deep=True) -> "Points": else: poly.ShallowCopy(self.dataset) - # if isinstance(self, vedo.Mesh): - # cloned = vedo.Mesh(poly) - # else: - # cloned = Points(poly) - cloned = self.__class__(poly) + if isinstance(self, vedo.Mesh): + cloned = vedo.Mesh(poly) + else: + cloned = Points(poly) + # print([self], self.__class__) + # cloned = self.__class__(poly) cloned.transform = self.transform.clone() @@ -2542,11 +2543,11 @@ def cut_with_mesh(self, mesh, invert=False, keep=False) -> Union["Points", "vedo self.pointdata.remove("SignedDistances") self.mapper.SetScalarVisibility(vis) if keep: - # if isinstance(self, vedo.Mesh): - # cutoff = vedo.Mesh(kpoly) - # else: - # cutoff = vedo.Points(kpoly) - cutoff = self.__class__(kpoly) + if isinstance(self, vedo.Mesh): + cutoff = vedo.Mesh(kpoly) + else: + cutoff = vedo.Points(kpoly) + # cutoff = self.__class__(kpoly) # this does not work properly cutoff.properties = vtki.vtkProperty() cutoff.properties.DeepCopy(self.properties) cutoff.actor.SetProperty(cutoff.properties)