You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This thread describes a way to extract cells of a given type via the programmable filter by first storing the types as cell data, and then thresholding a specific type:
od = self.GetOutput()
od.ShallowCopy(self.GetInput())
cta = vtk.vtkIntArray()
cta.SetName("cell types")
cta.SetNumberOfComponents(1)
cta.SetNumberOfTuples(od.GetNumberOfCells())
od.GetCellData().AddArray(cta)
for x in range(0,od.GetNumberOfCells()):
cta.SetValue(x,od.GetCell(x).GetCellType())
So the question becomes if we should still add this functionality to the ttkExtract filter. What do you think @julien-tierny ?
So the question becomes if we should still add this functionality to the ttkExtract filter.
I think so, yes.
programmable filters are for advanced users.
having it in ttkExtract would be very handy, for everyone.
cheers,
--
Dr Julien Tierny
CNRS Researcher
Sorbonne Universite
http://lip6.fr/Julien.Tierny
On Wednesday, 1 July 2020 00:05:42 CEST Jonas Lukasczyk wrote:
[This thread](https://vtk.org/pipermail/vtk-developers/2012-October/027819.html) describes a way to extract cells of a given type via the programmable filter by first storing the types as cell data, and then thresholding a specific type:
od = self.GetOutput()
od.ShallowCopy(self.GetInput())
cta = vtk.vtkIntArray()
cta.SetName("cell types")
cta.SetNumberOfComponents(1)
cta.SetNumberOfTuples(od.GetNumberOfCells())
od.GetCellData().AddArray(cta)
for x in range(0,od.GetNumberOfCells()):
cta.SetValue(x,od.GetCell(x).GetCellType())
So the question becomes if we should still add this functionality to the ttkExtract filter.
What do you think @julien-tierny ?
No description provided.
The text was updated successfully, but these errors were encountered: