[vtkusers] Points within radius

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Mon Oct 28 22:39:23 EST 2002

   For each point within the radius you could calculate the dot product
between the point normal and the line, and keep (or process) only those
with the desired sign.

  Dave Pont

|        |          Mysore Siddu           |
|        |          <siddumd at yahoo.co.in>  |
|        |          Sent by:               |
|        |          vtkusers-admin at public.k|
|        |          itware.com             |
|        |                                 |
|        |                                 |
|        |          26/10/2002 04:08       |
|        |                                 |
  |                                                                                                            |
  |      To:     vtkusers at public.kitware.com                                                                   |
  |      cc:                                                                                                   |
  |      Subject:     [vtkusers] Points within radius                                                          |

 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();<?xml:namespace prefix = o ns
= "urn:schemas-microsoft-com:office:office" />

                        float radius = 2.0;

                       vtkPointLocator *pointLocator = vtkPointLocator::New



ptline, res);


                        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


(Embedded image moved to file: pic06729.gif)Post your ad on Yahoo! India
Autos. Check out the used Maruti, Fiat and Ford models on sale now.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic06729.gif
Type: image/gif
Size: 479 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021029/c5c3f6d6/attachment.gif>

More information about the vtkusers mailing list