c674332 at web.de
Sat Nov 1 09:58:46 EDT 2008
Found out about the vtkImplicitModeller, replaced the vtkCellDataToPontData
with it and am satisfied with the result.
What I dislike though, is that the contoured polydata contains the isovalue
as scalar value and not the isovalue the cells had before. I could change
the isovalue of course, but the generated surface looks best with an
isovalue of 1. Therefore I want to change the scalar values to a specified
value, for example 16. Unfortunately GetNumberOfTuples() in the following
code gives me a segmentation fault. What do I do wrong or is there another
more efficient way to accomplish this?
vtkContourFilter* contour = vtkContourFilter::New();
vtkPolyData* polyData = contour->GetOutput();
vtkCellData* cellData = polyData->GetCellData();
vtkDataArray* colors = cellData->GetScalars();
for(int i=0; i<colors->GetNumberOfTuples(); i++)
Thanks in advance
> 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();
> vtkCellDataToPointData* conv = vtkCellDataToPointData::New();
> vtkContourFilter* contour = vtkContourFilter::New();
> vtkPolyDataWriter* writer = vtkPolyDataWriter::New();
> ostream *file= writer->OpenVTKFile();
> 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?
View this message in context: http://www.nabble.com/vtkContourFilter-tp20268264p20280652.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers