I would like to create a box around an object with a python script ! So I write the script which is in this topic : Create and export bounding boxes for objects
However here's what I get with my object:

I was expecting something more like this:

I don't know how to modify the script to get what I want
Have you guys any ideas on this ?