Seems just break all boxes into cubes, then draw in z index order is the best.
Also as some say, just throwing it into 3D and locking the perspective is waaaay easier on the math. For example, 2 of my own projects.
http://chad-autry.github.io/hex-grid-map/#/demo vs http://chad-autry.github.io/hex-grid-map-3D/#/demo