I'm trying to figure out a way to retrieve or select a group of vertices directly beneath a separate object.

I want to do this in a way that I don't have to iterate throughout the entire mesh to find the correct vertices. I was thinking of how blender is able to select things within the 'lasso select' or select things in other 'within region' shenanigans.

So my question is: Does blender always iterate through every single point in a mesh just to find what's within a certain distance, or to detect collision, or detect verts within a region etc?

Or is there a more graceful way to do this? I'm using landscapes with somewhat large amounts of verts, and this entire process will be iterated over for several different objects. I couldn't find anything helpful on google, and I'm not too sure where to look.

  • $\begingroup$ There are couple optimizations in place, to not iterate over every single vertex and compare that to something else (e.g. Remove Doubles does not compare every vertex with all other vertices). Algorithms like KDTrees, Hash tables etc. vastly reduce the computational complexity. I doubt there's a smarter way to find your vertices however (such a specific search would require its own pre-processing, but is likely way more expansive than a brute-force approach - unless you will re-use the result of the pre-processing several times). $\endgroup$
    – CodeManX
    Feb 9 '15 at 10:41
  • $\begingroup$ You should also check out my answer on how to select vertices inside the view frustum $\endgroup$
    – CodeManX
    Feb 9 '15 at 13:00
  • $\begingroup$ Funny, I was actually thinking about moving an orthographic camera view over above the verts I'm trying to select and selecting everything within view. That would be a last ditch resort though, as this thing I'm making is supposed to be meant for popular developer use, and that would be rather sloppy. Either way, I might use that. $\endgroup$
    – Dannyboy
    Feb 10 '15 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.