Testing if two objects are touching.

Hi everyone

I’m trying to write a script that takes a bunch of objects and combines them all into a single manifold mesh (or multiple manifold meshes in the case . Mainly this involves just doing a bunch of booleans, but I wanted to speed things up by just joining together objects with a simple bpy.ops.object.join() operator in the case where the objects aren’t actually touching.

Currently I’m just assuming the objects are spheres, and if the sum of their “radii” is greater than the distance between them, then I’m assuming they touch, but this is only a lame aproximation of what I actually want to check for. I think what I really need to be using is the ray_cast method, but having not used this before I’m not sure how if works. Any pointers anyone?