Is there a library which provides a
box(x1, y1, z1, x2, y2, z2) function (similar to the
line(x1, y1, z1, x2, y2, z2) one) and works out the size and rotation of the box, rather than needing me to calculate it (or which would help with the calculations)?

1