Open JonasLukasczyk opened 4 years ago
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 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 ?
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 ?