Artificial intelligent assistant

How many coffee beans fit in volume X? Good day dear Internet. I am Building a table out of palette wood. I want to fill in gaps between the boards with kitchen stuff, pepper grains, coffee beans and so on and fill that up with epoxy resin. I wonder if there is a way to mathematically aproximate the amount of resin I will need. For instance, the volume to fill would be 80cm by 10cm by 2.2cm, an average coffe bean be 1,5cm long and 0.8cm wide and 0.5cm thick, how many fit (whole) in there and what is the leftover volume? Of course there will be an error margin.

As menti0ned in the comments, trial and error might be the best option. But since you've asked, here is some math to give an upper bound: Assume a single coffee bean has the shape of an ellipsoid with axis lengths $a$, $b$ and $c$. Then its volume is $\pi/6\cdot abc$, whereas the quader it is inscribed in has volume $abc$, i.e. $(1-\pi/6)\approx48$% of the volume of the quader is leftover.

If the whole gap is filled in that way (namely with ellipsoids neatly sitting inside of boxes which are aligned next to each other), then the whole gap will have roughly $48$% leftover volume as well. Since in reality the coffee beans will be packed more densely, I would assume that you do not have more than $48$%$\times 8\times1\times0.22=0.92$ liters leftover volume.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 58c7adf3b9426408e672ff1ae7803704