I can think of another kludgy way wich I think would work quite well.
Rotate the mesh in all possible ways in steps of say 5 degrees.
For each rotation, and for each vertex, calculate (Tform) the worldspace x,y,z finding the smallest and largest x,y,z.
For each rotation calulate the volume (maxx-minx)*(maxy-miny)*(maxz-minz)
The smallest volume, is the best bounding box.
Rotate the mesh to best fit position, create the bounding box,
fitmesh(bestfitminx,bestfitminy,bestfitminz,bestfitmaxx,bestfitmaxy,bestfitmaxz)
and parent it to the mesh.
Rotate the mesh in all possible ways in steps of say 5 degrees.
For each rotation, and for each vertex, calculate (Tform) the worldspace x,y,z finding the smallest and largest x,y,z.
For each rotation calulate the volume (maxx-minx)*(maxy-miny)*(maxz-minz)
The smallest volume, is the best bounding box.
Rotate the mesh to best fit position, create the bounding box,
fitmesh(bestfitminx,bestfitminy,bestfitminz,bestfitmaxx,bestfitmaxy,bestfitmaxz)
and parent it to the mesh.