I'm experimenting with the bvhtree python module and am confused about the index attribute that's returned by find(). Assumption is that it's the vertex index but could be mistaken.


Also note that the documentation shows find_nearest() but the method is find() at the time of this writing

In the console with mathvis addon enabled, here's an example to test:

bv = bvhtree.BVHTree.FromObject(C.object, C.scene)
hit = bv.find(C.scene.cursor_location)[0]
index = C.active_object.data.vertices[bv.find(C.scene.cursor_location)[2]].co

enter image description here

but the hit and index don't match up as expected (would expect the vertex to be a little off but not across the shape). This is with a mesh object, no scale, no modifiers.

Supporting info is appreciated! Ideally I'd be able to get the vertex closest to a point with low overhead and easy syntax :)

  • 1
    $\begingroup$ For reference, I reported the discrepancy between find and find_nearest and the api has been corrected to match the documentation. From 2.77 BVHTree.find_nearest will need to be used. $\endgroup$
    – sambler
    Feb 8, 2016 at 2:15

1 Answer 1


It's the polygon (face) index.

It works like object/closest point on mesh . Not like kdtree, that gives vertex (vectors, points) relation


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .