[vtkusers] Points within radius

Mysore Siddu siddumd at yahoo.co.in
Fri Oct 25 11:08:32 EDT 2002


 Hi prabhu/Tim

Thanks for the response and it was very helpful. I have one more question to all the vtk users.

I am using stl reader and  vtkcelllocator to get a  line intersection point and its cellID. After this I tried to compute all the points that lie within radius of the intersection point.

To compute the points within radius I am using: 

pointLocator->FindPointsWithinRadius(radius, ptline, res);

Question is: As I looked at the normal of all the points within radius I discovered that most of the points are from inside surface, where as my intersection point is at outside surface. How to compute all the points that lie only on the outer side of the surface?

The code I am using for this is :

vtkIdList *res = vtkIdList::New();

                        float radius = 2.0;

                       vtkPointLocator *pointLocator = vtkPointLocator::New();

                        pointLocator->SetDataSet(stlreader->GetOutput());

                        pointLocator->BuildLocator();

                        pointLocator->FindPointsWithinRadius(radius, ptline, res);

                        pointLocator->Update();

                        vtkIdType ptId;

                        float *pt;

                        int num_pts;

                        num_pts = res->GetNumberOfIds();

                         for (int i=0; i < num_pts; i++) 

                          {

                          ptId = res->GetId(i);

                         pt = poly->GetPoint(ptId);

                         }

Thanks in advance

Siddu

 

Post your ad on Yahoo! India Autos.Check out the used Maruti, Fiat and Ford models on sale now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021025/ba264cd3/attachment.htm>


More information about the vtkusers mailing list