[vtkusers] vtkContourFilter issue
Bill Lorensen
bill.lorensen at gmail.com
Wed Dec 9 11:25:01 EST 2009
Print grid and post the results.
On Wed, Dec 9, 2009 at 10:17 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Wed, Dec 9, 2009 at 10:04 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> You need to set the value to be extracted by the contour filter. You
>> also need to Update() the contour filter before requesting its output.
>>
>> Or, did you just leave out those in your e-mail?
>
> Francois,
> Good point, that would have been a bug in my algorithm, but it
> shouldn't prevent SOMETHING from happening (i.e. not producing a
> PolyData with 0 points and cells).
>
> Bill,
> Yes, sorry I omitted that part:
>
> vtkSmartPointer<vtkContourFilter> contourFilter =
> vtkSmartPointer<vtkContourFilter>::New();
> contourFilter->SetValue(0, 0); // the 0th contour should be the 0 contour
> contourFilter->SetInput(grid);
> contourFilter->Update();
> vtkPolyData* surface = contourFilter->GetOutput();
> vtkstd::cout << "Number of points: " <<
> surface->GetNumberOfPoints() << vtkstd::endl;
> vtkstd::cout << "Number of cells: " << surface->GetNumberOfCells()
> << vtkstd::endl;
>
> Number of points: 0
> Number of cells: 0
>
> I checked that the values of 'd' that are being set in:
> grid->SetScalarComponentFromDouble(x,y,z,0,d);
> are valid and they are.
>
> Any other thoughts?
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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