[vtkusers] ExtractUnstructuredGrid not producing any output
Paul Cochrane
cochrane at esscc.uq.edu.au
Thu Apr 14 00:22:01 EDT 2005
Hi all,
I've got a problem with using ExtractUnstructuredGrid in that it doesn't
seem to produce any output from the filter. I have an initial unstructured
grid from which I want to extract a slab by using the SetExtent() function
(would work perfectly, I believe, for what I want to do). However, when I
pass the initial unstructured grid through the filter like so (python code):
# create the reader of the file
reader = vtk.vtkXMLUnstructuredGridReader()
reader.SetFileName(fname)
reader.Update()
# read the output into an unstructured grid
grid = reader.GetOutput()
# extract a subset of the grid
extractGrid = vtk.vtkExtractUnstructuredGrid()
extractGrid.SetInput(grid)
extractGrid.Update()
print extractGrid.GetOutput()
the print command shows an unstructured grid object with no data in it. I
will eventually add in the SetExtent function to extract the relevant
region, but just passing the grid straight through should get me the data
and grid back again (I tried using SetExtent with the extent of the original
grid, and still nothing came through).
I also found that viewing the same model with mayavi worked fine, but when I
added the ExtractUnstructuredGrid filter, the model disappeared.
I'm using vtk 4.2 (I've also tried it with the cvs version of vtk, but with
no success), on linux with the python wrappers.
What am I doing wrong here? Any help/hints would be greatly appreciated.
Paul
--
Paul Cochrane
Computational Scientist/Software Developer
Earth Systems Science Computational Centre
Rm 703, SMI Building
University of Queensland
Brisbane
Queensland 4072
Australia
More information about the vtkusers
mailing list