Skip to content

Commit

Permalink
remove self.__class__(kpoly)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Mar 1, 2024
1 parent 0221cbf commit 6a2acca
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions vedo/pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6a2acca

Please sign in to comment.