0
$\begingroup$

I am using BVHtree.overlap in a script to calculate the overlap between 2 meshes. If there is no overlap this returns None. If there is an overlap a list is returned. For example:

[(47491, 496), (47491, 498), (47310, 498), (47309, 498), (47036, 491), (47036, 498), (47581, 496), (47581, 489), (47580, 489), (47401, 496), (47035, 491), (47307, 489), (47216, 491), (47217, 491), (47032, 491), (47399, 489), (47308, 489), (46852, 491), (47031, 491), (47134, 489), (47134, 465), (46851, 491), (47030, 467), (47030, 465), (46934, 491), (46934, 467)]

What do the values in this list represent?

$\endgroup$
0
$\begingroup$

mathutils.bvhtree.BVHTree.overlap returns a list of unique tuples, where each tuple represents the overlap between two elements of the two trees. The first entry of each tuple is the index from one tree and the second entry is from the other tree.

overlap(other_tree)

Find overlapping indices between 2 trees.

  • Parameters: other_tree(BVHTree) – Other tree to perform overlap test on.

  • Returns: Returns a list of unique index pairs, the first index referencing this tree, the second referencing the other_tree.

  • Return type: list

$\endgroup$
2
  • 1
    $\begingroup$ Is it possible to retrieve XYZ coordinates of the overlap from this list of index pairs? I sorry if this is a stupid question. I am quite new to blender. $\endgroup$
    – Bram
    Oct 31 '19 at 13:49
  • 1
    $\begingroup$ @Bram Sorry for my late reply. The indices are for the polygons that are intersecting. Describing an intersection through XYZ coordinates is not the right approach since that would only be the case if the two polygons touch at exactly one point, usually it would be a line of the two planes intersecting (or even more complex shapes with quads and ngons that are not planar). $\endgroup$
    – Robert Gützkow
    Nov 1 '19 at 12:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.