The internet contains some references to a certain method to optimize the amount of paper required to wrap a gift; namely, turning the gift box diagonally relative to the sheet of wrapping paper. See for instance "How to Wrap a Present With Mathematical Precision" (via MentalFloss) and "Wrapping presents on the diagonal" (via YummyMath) and "Gift Wrapping Math" (via Math Encounters Blog).
However, in these pages details seem lacking. For instance, I would expect to see a formula for the amount of necessary paper as a function of the wrapping angle $\theta$, and then a minimization to compute the optimal angle $\theta$.
Is there a reference with a more detailed mathematical derivation of this optimality result?