[vtkusers] Contouring an unstructured grid

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 15 08:29:26 EST 2008


What is the scalar range for your data?

On Mon, Dec 15, 2008 at 6:03 AM, Benjamin Schindler
<bschindler at student.ethz.ch> wrote:
> Hi
>
> In the vtk Users Guide I read that it's possible to contour a
> UnstructuredGrid using vtkContourFilter. I tried, but I got no visible
> output, so I've got a few questions:
>
> - How do I set the scalar for contouring?
> - Am I missing something in the code below (besides setting active scalar)?
> (Because paraview wasn't able to display anything as well even though the
> data range seemed to match)
>
> contourfilter = vtkContourFilter::New();
> normals = vtkPolyDataNormals::New();
> contourmapper = vtkPolyDataMapper::New();
> contourActor = vtkActor::New();
>
> contourfilter->SetNumberOfContours(1);
> contourfilter->SetValue(0, 0);
> contourfilter->SetInputConnection(reader->GetOutputPort());
> normals->SetInputConnection(contourfilter->GetOutputPort());
> contourmapper->SetInputConnection(normals->GetOutputPort());
> contourActor->SetMapper(contourmapper);
> renderer->AddActor(contourActor);
>
> Thanks
> Benjamin
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list