OpenSCAD script that generates a 3D box of user-defined interior dimensions. The boxes have an interior throat which the lid sits on (hence the name). The length of that throat can be controlled, as can the general thickness of the sides.
I created this to make a small gift box.
Change the interior size dimensions. If your build platform is not large enough to print both top and bottom at the same time, you may need to separate them into separate objects, or comment out one and export the other.
I had to resort to two subs for thick and thin walls because of the way OpenSCAD works with regards to variables. Thin walls are derived as a percentage of the shortest dimension of the box. Thick walls are proportional to the dimension of the side they are on. Thickness of the walls are defined by inner and outer sides variable - the throat is the inner side, and the outer side surrounds it. Slop adds a little space to the inside of the lid so that it can fit - unless your 3D printer does perfectly smooth walls, you will probably need some slop, but you'll have to experiment to determine how much.
I plan to fix the annoyance with the variables and add a top|bottom|both switch to let you control which parts get rendered without having to comment out code, so I have set this to be a work in progress.