[vtkusers] Problem with Poisson Reconstruction filter
David Doria
daviddoria at gmail.com
Thu Sep 23 09:28:29 EDT 2010
On Thu, Sep 23, 2010 at 8:20 AM, niccolo camarlinghi
<niccolo.camarlinghi at gmail.com> wrote:
> Dear vtk users,
> i'm trying to reconstruct a surface from a cloud of points.
> Since i'm not satisfied with Delaunay filter, i was trying to use, Poisson
> Filter (which is not contained yet in the official release) together
> with vtkPointSetNormalEstimation .
> When i run the code i obtain "The data set does not contain normals! This is
> a fatal error!".
> I attach a little piece of code to explain what i'm doing.
> Maybe there is something wrong in the polydata i'm using...
>
>
> std::cout <<"Evaluating Triangulation with poisson reconstruction filter"
> <<std::endl;
>
> // the input data
>
> vtkSmartPointer<vtkPolyData>ListaPunti=vtkSmartPointer<vtkPolyData>::New();
>
> ListaPunti->SetPoints(Points); // Points is vtkPoints smartpointer
>
> ListaPunti->SetPolys(CellArray); // CellArray is vtkCellArray smartpointer
>
> // normal estimation filter
>
> vtkSmartPointer<vtkPointSetNormalEstimation> normalEstimation =
> vtkSmartPointer<vtkPointSetNormalEstimation>::New();
>
> normalEstimation->SetInput(ListaPunti);
>
> normalEstimation->SetkNeighbors(5);
>
> normalEstimation->Update();
>
> // poisson filter
>
> vtkSmartPointer<vtkPoissonReconstruction> poissonFilter =
> vtkSmartPointer<vtkPoissonReconstruction>::New();
>
> poissonFilter->SetDepth( 8 );
>
> poissonFilter->SetInput(normalEstimation->GetOutput());
>
> poissonFilter->Update();
>
> Any help will be appreciate.
> Thanks
> Niccolo' Camarlinghi
Hi Niccolo,
It's great to see people are using (well, trying to use!) this code.
Were you using the version from the VJ paper? You will likely have
better luck if you use the latest version. We have made a VTK branch
here:
http://github.com/daviddoria/daviddoria-vtk/tree/VTK-PointSetNormalEstimation
which contains vtkPointSetNormalEstimation in the Filtering directory.
Arnaud has contributed vtkPointSetNormalEstimationFilter which does
the normal estimation and orientation in a single step.
Also, I just made a small change to the PoissonReconstruction :
http://github.com/daviddoria/PoissonReconstruction
to attempt to get the normals by array name ("Normals") as well as by
the Normals attribute flag. These two things
(vtkPointSetNormalEstimation and vtkPoissonReconstruction) should work
together now.
Give it a shot and let me know if you have any problems. If you do,
please send me the simplest piece of code that will produce the error
and I'll take a look.
Thanks,
David
More information about the vtkusers
mailing list