# Design into 3D: Boxes: Coopered boxes

One distinctive form of box is the traditional steamer trunk or chest with a coopered lid, often depicted as a pirate’s treasure chest:

It should be possible to model one programmatically, and to then cut out the parts for the lid using Carbide Create Pro’s 3D modeling (or by using a V endmill of an appropriate angle — anyone know of a source for V endmills of arbitrary angles? Not just the 15, 30, 45, 60, 90, and 120 typically available?)

First, let’s model the gross dimensions and shape of the box.

2 Likes

The basics are quite straightforward:

Next up is working out the arc necessary for a curve which reaches from the edge of the box at the front/back up to the center height.

2 Likes

We have the following dimensions:

• the height of the rounded portion of the lid (boxheight times 100 - lidproportion as a percentage)
• the length of the chord (== box depth)

The radius of the circle will equal

``````height / 2 + chord^2 / (8*height)
``````

So we have:

1 Like

A quick check, and the parametric values work:

1 Like

Next, we need to segment the lid and determine the angles which will be used for it (there will be two, one for the slats, and another for where the lid meets the vertical of the front or back).

In order to do this, we will need to determine how many pieces to segment it into. Options are providing an interface, or doing it algorithmically (mental note on the interface — the range for the lid proportion should be from 50–90 or thereabouts, or if 100 is allowed, there should be a check to switch to making a flat topped box).

On that note, affording the user control over this with a reasonable range makes the most sense., so we’ll start with 8 slats.

First, we need to determine the chord and height for sub-dividing this thusly.

Begin by calculating the angle from the central point of the arc to the lid/front or back interface (it will need to be divided into half so as to make this a right angle calculation using the Pythagorean theorem).

Actually, this will require the board thickness be known, so we add in a requirement that the user input that:

(we’ll work out the details of the joinery later — perhaps straps and angles with drilled holes?)

On second thought, having the user plug in the board width available and having the program calculate based on that makes more sense — disabling some parts and adding some variables:

• boardwidth
• boardgap

will allow us to work this out. Starting with the base:

We start by doing the math to determine how the width of the boards and the board gap interacts with the base — rather than machining all of the boards, we will place boards from center in, and adjust the width of the board in the center.

It is assumed that the user will specify a box dimension which is suitable to allow for at least two full width boards at the base, and one full width board reaching up from the base. Adding validaton for that would be a worthy improvement for later.

We will need a variable for the base width which needs to be infilled:

``````basewidth == boxdepth - (boardwithmax + boardgap) * 2
``````

and that will then need to be used to determine how many full boards will fit, and the dimension of the odd center board

Ideally all of this would get calculated out so as to provide a cutlist.

There are 3 possibilities which have to be accounted for:

• only one infill board is needed (basewidth <= to boardwidthmax) — the gaps around this were already subtracted
• an even number of full boards and one infill board are needed
• one full board and one infill board are needed

the combinatorial nature of which suggests another approach: count how many boards are needed:

• 1 or less — cut the board to width
• 2 - divide and cut a pair of boards to width
• 3 - divide and cut 3 boards to width
• 4 or more — this would then be divided between the cases of
• even # total
• odd # total

So, we need a bit of logic to handle the possibilities.

We start with a test of the simplest:

and iterate from there.

Next up is greater than 1, but less than or equal to 2:

Similarly, evenly dividing into 3rds is simple:

Last is 4 or more, and that should be divided between even and odd.

Interesting. I first started coding using Google AppInventor where they used the puzzle style drag/drop building. Had no idea it made it’s way into CAD. This is pretty cool.

1 Like

For the even we count by 2 and lay down opposite boards until we don’t quite meet in the middle:

then we have to calculate the remaining space, divide it by two and fill it.

It may be necessary to revisit this and work out different options depending on the proportions:

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.

On third thought, a discrete number of boards makes more sense (and is certainly easier to program).

Trying again, (briefly considered openjscad, but it didn’t work out).

As before, we make variables:

This time, we use a module:

and we assume that the box will be wider than it is deep, and in keeping with that, we have the boards in the bottom run from front–back.

and we have the bottom portion of the box pretty much done:

and adding a sawkerf dimension allows us to have a lid base which efficiently uses two boards cut in half:

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.

Dimensions which we have:

• the length of the chord of the arc (this is the box depth)
• the radius of the circle

Drawing things up we have:

2 posts were split to a new topic: Design into 3D Kickstarter Book Status