I notice that when you create a bmesh from an object using
bm = bmesh.new()
bm.from_mesh(obj.data)
the scale of the object is ignored, in the sense that you get the same bmesh regardless of whether you do
obj.scale = (100, 100, 100)
or not.
Is this a bug or a feature?
I feel this is a bug since if you are doing ray casting, you should build the BVH tree with the scaled object for correct behaviors, but right now, if you just create your BVH tree from the mesh data, you are ignoring the object scale.