How to check this calculation
Formula & conventions
Only selected edges are added. Each segment receives allowance at both ends, followed by percentage reserve. Each colour and width combination is purchased separately, rounding rolls up.
B = Σ q × (nL × L + nW × W); R = ceil((B + 2 × a × N) × (1 + p) / r)
Position origin: left edge or base indicated in the drawing.