ttk icon indicating copy to clipboard operation
ttk copied to clipboard

ttkExtract should provide a new mode where one can extract cells of a specified dimension

Open JonasLukasczyk opened this issue 4 years ago • 2 comments

JonasLukasczyk avatar Jun 29 '20 13:06 JonasLukasczyk

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 ?

JonasLukasczyk avatar Jun 30 '20 22:06 JonasLukasczyk

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 ?

julien-tierny avatar Jul 01 '20 06:07 julien-tierny