It is currently not easy to get the data out of the mesh analysis tool via Python. The data is not available in Python. But there are possibilities.
Solution: implement overhang in python
Implement the mesh overhang functionality yourself. The C-code is located in
source/blender/blenkernel/intern#statvis_calc_overhang and is quite easy to implement.
- Calculate the face normals.
- Determine angle between the face normal and the chosen axis (normalized dot product).
- Use a color ramp between the angle to get a nice coloring.
Solution: change the API
Ask the developers or patch blender yourself to change the API so that the data can be read. The data is currently stored in the
edit_bmesh so it might become part of the bmesh api. Personally I would suggest a more cleaner approach outside
Solution: Use as_pointer and interp the internal structures of Blender
as_pointer to get a reference to the internal DNA structure of the mesh and use
ctypes to read the data from the internal structures. But note that changes in ctypes might make your code invalid.