rccm.kyoshimi at gmail.com
Sat Dec 9 05:49:29 EST 2017
The searching range for location selection of points is limited by
EPSILON key. You can set a bigger value to expand the searching range
2017-12-02 0:45 GMT+09:00 Amine Aboufirass <amine.aboufirass at gmail.com>:
> I am trying to figure out how to select the closest neighboring points to a
> list of coordinates using the vtk library. I have a simple point data set in
> the Unstructured Grid Format. The dataset contains one attribute named the
> 'point_id' which is just enumerating the points starting from 1 instead of
> 0. The raw text from the ASCII file is attached in testScalar.vtk below.
> I have also written a script in python which I thought would function as
> List of tuples containing world coordinates [(X1,Y1,Z1),(X2,Y2,Z2)]
> name of attribute to extract as a string. in this case "point_id"
> List of floating point values of the attribute for the selected points
> This does work to a certain degree, for instance when I do :
> ExtractByLocation('testScalar.vtk', [(5.999,0,0)], 'point_id')
> I do indeed get back the following:
> array([ 2.], dtype=float32)
> So point_id 2 is the closest point to the coordinates I have specified.
> However, as soon as I get a bit too far from one of the points, the function
> starts returning an empty list. For instance:
> ExtractByLocation('testScalar.vtk', [(5.888,0,0)], 'point_id')
> array(, dtype=float32)
> I found out that the cut off point is 5.89-5.90. If I plugin 5.9 I get the
> point, if I plugin 5.89 I get back an empty list.
> According to the object reference
> LOCATIONS is supposed to select the points near the supplied world
> coordinates. Is there an option or something that selects the nearest point
> PERIOD? i.e using a simple distance formula? I would like to never get back
> an empty list but always get back a list of the closest point to the
> supplied coordinates.
> Kind Regards,
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the VTK FAQ at:
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
More information about the vtkusers