The Maya API provides the *MMeshIntersector *class for optimized lookup of the closest point on a mesh. There's also the *closestPointOnMesh/Surface* node that you could use. I also recall an equivalent mel command but that required an external plugin. A simple loop over all point coords would work, but could be extremely inefficient and slow - for each given point you will have to go through *all *to find the closest one.
- Ofer www.mrbroken.com On Tue, Aug 10, 2010 at 2:00 PM, Alan Fregtman <[email protected]>wrote: > Hi guys, > > Say you have a Python list of x,y,z positions in space... > > What would be the most efficient way to figure out what vertices the > positions belong to? > > Is there a way to query for nearest vertices from a position vector in > space? Or would you fetch all point coordinates and then loop until > the xyz positions match within a threshold? > > > -- Alan > > -- > http://groups.google.com/group/python_inside_maya -- http://groups.google.com/group/python_inside_maya
