@john.uhden wrote:
If there isn't at least 3 feet more than what's needed for the next liner, then they'll send the roll back ....
Your BTW #2 implies there's something hard-to-derive about the calculations, which implies a certain level of precision that I assumed, which 3' of "slop" argues against, but overthinking or not, here's my approach.
The formula I alluded to before is in line 49. Think of the incremental increase in circumference per layer as billiard balls -- the cumulative total over the layers [beyond the first one] of one bit of extra to add for the second layer, two for the next, etc. The formula for the total of a "pyramidal" stack like that, with X rows, is X times {half-of-X-plus-one-half}. Just plug in X [X=5 gives you the 15 billiard balls], and no repeating X times, and adding up along the way, is needed. One line of code sums up the whole thing.
The code assumes the 3 standard thicknesses you list are all that are allowed, but it could be made to allow additional values instead of limiting it to those 3. It offers 20-mil as initial default. It offers 3.5" as the tube initial default diameter, though for that it allows any positive size input. It forbids invalid [including negative] inputs for tube diameter and outside roll diameter in relation to it.
And in case one enters a roll diameter that is not a multiple of sheet thickness beyond the tube diameter [as is the case with your 11" vs. 3.5", which at 20 mils comes to 187.5 layers], it (fix)es the result, since you can't have a half-layer in terms of thickness. It could instead round it to the nearest value up or down, instead of (fix)ing [rounding downward only].
Kent Cooper, AIA