[vtkusers] vtkContourFilter

c674 c674332 at web.de
Fri Oct 31 11:28:29 EDT 2008


Hi,

I've been posting this question in the developers list by accident, sorry
for that - and thanks to David for his answer.
What I am trying to do is put a surface over data in an unstructured grid,
containing cubes with cell data. My code looks like this:

	vtkUnstructuredGridReader* reader = vtkUnstructuredGridReader::New();
	reader->SetFileName("test_input.vtk");
	reader->Update();
	vtkCellDataToPointData* conv = vtkCellDataToPointData::New();
	conv->SetInput(reader->GetOutput());
	vtkContourFilter* contour = vtkContourFilter::New();
	contour->SetInput(conv->GetOutput());
	contour->SetValue(0,1);
  	vtkPolyDataWriter* writer = vtkPolyDataWriter::New();
	writer->SetFileName("test_output.vtk");
	ostream *file= writer->OpenVTKFile();
        writer->WriteHeader(file);
        writer->SetInputConnection(contour->GetOutputPort());
	writer->Write();
        writer->CloseVTKFile(file);

Unfortunately my output file does not contain any data. The cell data is in
the range from 0 to 40. Does this give a hint on how to chose my isovalue?
I've played with that value a lot, without success.
When replacing the vtkCellDataToPointData with a
vtkSurfaceReconstructionFilter I get output for isovalues between 1 and 3,
I'm not satisfied with the look of the output though and I want it to work
without that filter.
What is the role of the isovalue anyways? I thought it was no more than some
kind of threshold, to decide which points are taken into account - but then
isovalues between 0 and 40 should give output, shouldn't they?

I appreciate any help!
-- 
View this message in context: http://www.nabble.com/vtkContourFilter-tp20268264p20268264.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list