Next, we do something similar for the sides — here though we want to try to use stock efficiently since there are four sides — we assign half the board maxwidth to be added to the lid (one would rip a board each for the sides and front/back) — since the sides will be visible, we calculate how many boards there should be and then evenly distribute the height for a more regular appearance.
Note that we will also need to go back and revisit there being an odd number of boards for the base — probably the code could be re-used, just skip dividing at the last step — for sense it will probably be necessary to rename some variables.
Next up is working out the math to place a board at the top of the arc for the box lid (adjusted by the board’s final width) and to determine how many boards will be necessary and at what angle(s) they will need to be cut along their edges.
arclength — this will be the length of the arc for the chord defined by boxdepth and the circle made by r determine by 2 \pi r (arcangle/360) (see: https://www.mathopenref.com/arclength.html )
A further consideration, for maximum interior volume we want the board edges to meet at the internal edges, which makes the boards which meet the lid skirt want a two-sided operation:
Okay, the 2 sided top is pretty much just a placeholder. For the 3 faceted top, we actually want good engineering and connections, so we need to angle the parts thus: