An unusual (for me at least) geometry problem

I designed a 3D printed box with a screw-on top. Because I used a 5-sided squircle shape for the box’s outside I had to make a cylindrical inside to accommodate the screw threads. the box top and bottom look like this:

The problem, of course, is that when I screw the top onto the bottom all the way it looks like this:

By loosening the top a wee bit the top and bottom do line up:

but even though it looks OK the top is not tight.

So my question is this: is there a way other than trial & error to determine how to rotate the threads in a way that allows the top and bottom to line up with they are screwed all the way together? I know I could do it by trial and error, but it takes 7 1/2 hours to print the top, and it uses a fair amount of filament in that time. Consequently trial & error is not an appealing option.

Note that I have tweaked up my own little cluster for making the threads. It is a modified version of one I found here years ago. The threads it makes are not compliant with any industry standard, but they do work nicely for 3D printing. I’ve attached the cluster to this thread if anyone is interested.
threads.gh (13.5 KB)

You could print a similar container less high, basically just the part which has the threads…

Yes, but…size matters!

Try what machinists call a ‘shoulder bolt’, that is, design a stop at the end of the thread so the lid will not go any further. Make the stop longer than you need, then you can fine tune the length with a file or sandpaper.

1 Like

Gosh, that’s a very clever solution. I would never have thought of anything like that. It’s only plastic for me, so doing that should be fairly easy. Thanks for the tip.

3:00 am ideas…

If you will use again the same parameters for the 3d printing, same thickness, same material, you can roughly measure the angle you need to screw more (or less) to align the shape, divide that angle by 360, and multiply that for the step of the thread, and remove (or add) height to the bottom shape.


Doing this for a different shape and/or material/thickness etc … i guess it will still be a gamble.


I would design it so the screw is expected to close a little “early”, and then with some sand paper you remove some material in the bottom part until it align once closed.
You can still do this in the print in your photos. You need to remove more or less 1/10 of the thread step from the bottom part.
Working PLA is a mess though…
Is that PLA?


Make 3 pieces: bottom, top, screw top.
Add some glue from top and screw top (which will have a cylindrical interfacing), screw until aligned (the screw part will be free to slide a bit from the top part), wait until glue solidify.


If you have an advanced programmable 3d printer you could add a pause every 4 (or else) layers in the last millimeter of the print, so you can try to screw the top part and stop the printer when it align good with the top… like with some M01 code or something (you need to move away the printer head, and not wait too much or the thermal shrinking will create a line in the model…)

Oh my! Those are very sophisticated solutions. I will have to give them some serious thought. Thanks. And yes, it is PLA - I don’t like having to change settings for different materials.