I'm trying to find the closest vertex on a mesh but within a radius. This is to avoid having to loop through all the vertices as that's time consuming. Example, I have 2 shirts with different vertex count and I'm trying to find the closest vertex of vertex1 that's on mesh2's right sleeve on mesh1's right sleeve. I don't want to loop through verts beyond the sleeve as logically no vertices will be close enough. I understand that there is an assumption that there could be other vertices closer, but for the usage I'm looking for, I don't foresee that being an issue.
I have the code to loop through vertices and get the closest point, but if the mesh has a high vert count, it takes a long time, even if it's using the API.
Is there a function in maya that lets you limit vertices based of a radius? Or any tips on how I can write a function that could do that?