I have a VTP file with some number of Pieces in it, representing separate geometry regions. What I want to do is to assign a separate actor for each Piece to be able to differentiate them using picker in Paraview Shell script. There’s a reader in vtkmodules called vtkXMLPolyDataReader which has a property GetNumberOfPieces returning correct number of pieces in VTP file after reading.
The question is how to extract the data belonging to a particular Piece?
reader = vtkXMLPolyDataReader() reader.SetFileName(filePath) reader.Update() mapper = vtkPolyDataMapper() mapper.SetInputData(put here code to extract data for i-th piece)
This is VTK inside Paraview Python Shell question. I know there is a VTK specific forum but I`m sure this is a better place to ask. Because mentioned reader and overall approach should work inside Paraview.
If it is not supposed, why is it available through the API?
Let’s imagine that this is the VTK question under Python API. How can I get geometry data for separate piece from the VTP file red using vtkXMLPolyDataReader?
If it is not supposed, why is it available through the API?
It is not available unless you import VTK specifically.
Let’s imagine that this is the VTK question under Python API. How can I get geometry data for separate piece from the VTP file red using vtkXMLPolyDataReader?
Is your dataset separated in pieces ?
If that is the case, use UpdatePiece: