Stacking things of different thickness to approximate desired thickness
This is as hard as the subset sum problem.  The subset problem asks "is there a way to get exactly the desired thickness?".  Obviously, if we could solve your problem, we could also solve the subset sum problem.  Unfortunately, the subset sum problem is NP-hard, so your problem will be too.

In practice you can try using an approximation algorithm for the subset sum problem, e.g., by rounding to the nearest integer (or to the nearest multiple of $1/k$ for some $k$) and then applying the dynamic programming algorithm for subset sum.  See, e.g., https://en.wikipedia.org/wiki/Subset_sum_problem