[vtkusers] vtkPointLocator Problem

A. Burak Yoldemir yoldemir at gmail.com
Wed Jun 9 16:50:08 EDT 2010


Yes, I am aware of that example, but I have no solution to my problem. What
I want is to use a vtkPolyData object as the dataset of a vtkPointLocator.
Here is my problem in a nutshell:

- I have a number of points in a vtkPoints object.
- Then, I create a vtkPolyData object and use the SetPoints function of it
to define the point coordinates.
- Next, I create a vtkPointLocator object and use the SetDataSet function of
it to build the locator from these points.
- Finally, I use FindPointsWithinRadius function for a point which has many
neighbors (just manually checked), but no neighbors are returned.
- I also tried FindClosestPoint function for each of my points. At each
time, the closest point ID turns out to be 0, however it actually is not.

What might I be missing?


- Ahmet Burak Yoldemir


On Wed, Jun 9, 2010 at 1:04 AM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> Have you looked at this example:
> http://www.vtk.org/Wiki/VTK/Examples/PointLocator_Radius
>
>
> On Tue, Jun 8, 2010 at 4:49 PM, A. Burak Yoldemir <yoldemir at gmail.com>
> wrote:
> > Hello all,
> >
> > I am having a problem with FindPointsWithinRadius function of
> > vtkPointLocator class. I have a bunch of points in a certain volume, with
> no
> > specific topology. Using the following code snippet, I create a point
> > locator object and specify its data set:
> >
> > vtkPoints* edge_pts = vtkPoints::New();
> >
> > for(int i = 0; i < someLimit; i++)
> >
> > {
> >
> > edge_pts->InsertNextPoint(somePoint);
> >
> > }
> >
> > vtkPolyData* edge_pts_set = vtkPolyData::New();
> >
> > edge_pts_set->SetPoints(edge_pts);
> >
> > edge_pts_set->Update();
> >
> > vtkPointLocator* NeighborLocator = vtkPointLocator::New();
> >
> > NeighborLocator->SetDataSet(edge_pts_set);
> >
> > NeighborLocator->BuildLocator();
> >
> > Then, I use the FindPointsWithinRadius function of NeighborLocator, where
> I
> > (manually) made sure that there are several neighbors of the query point.
> > However, the aforementioned function returns no neighbors. Any ideas on
> > where the problem could be?
> >
> > Regards,
> >
> >
> > Burak
> > _______________________________________________
> > 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100609/68b218e9/attachment.htm>


More information about the vtkusers mailing list