[vtkusers] Find closest point

David Doria daviddoria at gmail.com
Mon Sep 19 19:08:16 EDT 2011


On Mon, Sep 19, 2011 at 5:46 PM, nuno.jf <nunofernandes7 at gmail.com> wrote:
> I tried passing the polydata through vtkTriangleFilter before applying
> smoothing, but I got the same error.
> I attached the source file I'm using:
> http://vtk.1045678.n5.nabble.com/file/n4820603/test.txt test.txt
> I don't understand why does happens.
>
> //Read polydata
> vtkPolyDataReader * imp1 = vtkPolyDataReader::New();
> imp1 -> SetFileName(argv[1]);
> imp1 -> Update();
> I tried
>
> vtkPolyData * polydata= vtkPolyData::New();
> polydata= imp1 -> GetOutput();
> polydata-> Update();
>
> //vtkTriangleFilter
> vtkTriangleFilter * teste = vtkTriangleFilter::New();
> teste -> SetInput(polydata);
> teste -> Update();
>
> //WindowedSincPolyDataFilter
> vtkWindowedSincPolyDataFilter * smoother =
> vtkWindowedSincPolyDataFilter::New();
>
> smoother->SetInput(teste->GetOutput());
> smoother->SetNumberOfIterations(20);
> smoother->SetPassBand(0.1);
> smoother->Update();

I replaced the file reader with a vtkSphereSource and it runs fine.
The problem must be with your data. Please upload your data.

David



More information about the vtkusers mailing list