[vtkusers] Contouring an unstructured grid

Benjamin Schindler bschindler at student.ethz.ch
Mon Dec 15 08:31:47 EST 2008


Hi

Well, I suspect the default channel is the index channel, which 
obviously has no matching range. That's why I would like to set 
FLUID.pressure as the active scalars but have not figured how. The 
pressure channel has a -700 to 3000 range, so it clearly should work

Cheers
Benjamin

Bill Lorensen wrote:
> 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