Jump to content
Ultimaker Community of 3D Printing Experts

Experiment with threads.

Recommended Posts

For some time I've been meaning to have a go at printing real metric threads, to see how well it worked. I'm designing in OpenSCAD and I've tried the internal threading library and a couple of others, without much success - I get loads of warnings in OpenSCAD - and what seems to be a total lockup, though maybe I just didn't wait long enough.

That's just for background, I'm not looking for OpenSCAD support here. Anyhoo, I came across an "ISO metric thread library" on Thingiverse, by "TrevM", and it has been much more successful. See below for a result of a quick test of printing a hex nut and bolt.


Points to note:

These are an M10 nut and bolt. The inset picture is the same hex nut flipped over to let you see the underside.

The bolt is particularly successful, nice clean realistic looking threads. So realistic in fact that that's a real steel M10 nut you see screwed onto it. There's a teeny bit of play in the nut, but perhaps I could fix that with tuning.

The hex nut is... not so successful. It went great until z=1mm (approx - I suspect it's the 1.2mm shell thickness I set), at which point I saw what looked like stray hairs crossing the hole, however when I came back an hour later it looks like a solid plug filling the hole (top right of pic). Support was turned off. The nut looks ok in Cura and other views prior to slicing. Cura was the slicer btw. Nut and bolt were printed at the same time.

I tried to fool the site into letting me upload a zip file containing the project files, but I couldn't see a way to link it to this message. I can email it to anyone interested if they pm me an email address (offer valid for a couple of days only!). Alternatively, suggest a way to attach a zip.


Share this post

Link to post
Share on other sites

90% likely that you have "expert settings" "fix horrible" "type A" checked. Uncheck that. But before you do look at the part in the layer view to verify the problem exists, then uncheck, then look again to verify that this fixes your problem.


Share this post

Link to post
Share on other sites

Yes, that was it, well done and thank you. Here's the new nut added to the original bolt. I'm not sure how that "Fix Horrible" option got set.

Score one more for TrevM's thread library. Unfortunately the external size of the nut and the head of the bolt don't match what I expect for metric fasteners, but that should be easily fixed. Still, the threaded part is near perfect and it's all a huge step up from the other libs I tried that didn't work at all.



Share this post

Link to post
Share on other sites

That option is unfortunately (?) checked by default so it's not something you did.


Actually, it's unfortunately that there is a bug in it that causes some layers to get filled if the model is very high polygon.

Fix is in 14.02. Workaround is unchecking the option.


Share this post

Link to post
Share on other sites

To be honest I never considered any of the "fix horrible" options failing as a bug. I just figured it did the best it could and hoped for the best. If it fails, if fails, try some other option :) After all it's trying to guess what should be done with a model that is bad. Good to hear it's fixed though.


Share this post

Link to post
Share on other sites

I thought people might like to see what I did next with this capability. For an outdoor project I wanted to make a pulley and a bracket to hold it. This will be bolted on to a chicken coop and guide the raising and lowering of the pop hole door. I originally intended that I'd use a steel M6 bolt as the pulley spindle, but then it crossed my mind that PLA might be preferable: it won't rust, and I can make a custom bolt that perfectly fits the application. See below :-


This time it was an M6 bolt and two nuts so they can lock together and still allow the pulley (shown) to turn freely. From the thread above you'll see that M10 worked well. I was concerned that the finer detail required for M6 threads might be pushing the capability of the printer, but in fact they came out near perfect: not up to professional standards, but probably as good or better than I could do with a handheld tap and die in my workshop.

Below is the completed bracket, pulley and spindle. All designed and printed from scratch this weekend.


Sorry guys that the pictures continue to be so crappy. Photography is not one of my hobbies, so this is done using the phone in my camera, and not very good lighting. Still, hopefully you can see everything you might need to.

My UM2 continues to produce excellent quality ever since I had to re-level it after the stuck filament episode. All these prints were done in Cura without support. 1.2mm shell, 25% fill.


Share this post

Link to post
Share on other sites

Hi there,

Just got my Ultimaker 2 a few days ago and this is my first forum post. :)

I am trying to print a nut and bolt based on this thread, but I am not having any luck.

I know this thread is a year old, but I was wondering if DonMilne or anyone else could share their specific settings that got this to work. (Or should I start a new thread?)

On my side, I have tried print an M8 and an M9, using the updated version of TrevM's library, on normal, high and ulti quality quickprint profiles. I have tried slowing speed to 5 mm/s on all speed settings, I have tried disabling combing. I have been using a shell thickness of 1.2 and 25% infil, per DonMilne's information. I have also tried turning off "combine everything (type-a)". Lastly, I am using Ultimaker Silver PLA for this.

The problem seems to be sagging or bubbling on the threads. I will post a picture just as soon as I figure out how to do it here. :)

I am not usually one to post on forums, but this one has defeated me. :) Any wisdom shared would be much appreciated.

Thanks in advance.


Share this post

Link to post
Share on other sites

I'm afraid I don't remember the details of what settings I used. I would have used the expert settings and used 0.1mm layers. Print speed would have been mid range (say 45 mm/s). I suspect that making it as slow as 5 mm/s might be counterproductive.

The filament was the UM blue that came with the printer.

You don't mention temperature: I would avoid getting the temperature too high.

I still have the openscad scripts, stl files and gcode files for some of the above projects (definitely the M6 bolt and two nuts). You could use these to verify the results on your own printer - you can extract Cura settings from a gcode file. If you pm me an email address then I can send what I have to you.


Share this post

Link to post
Share on other sites

I just did, and the parameters are what you'd expect from the above discussion. The actual print speed seems to have been 50mm/s.

I downloaded the new version of trevm's library, and I have to say that the threads look rougher to me. He seems to make the thread out of lots of little prism shapes, and I'm seeing gaps between the separate prisms... which Cura probably won't like at all. In fact, a picture is worth a thousand words, so here's two pictures: the STL, and then a closeup of the threads in Cura. The height of the threads seem to have changed slightly too, i.e. they are now protruding from the plain part of the bolt.

I'll redo this with the old library and see if it was like this before.




Share this post

Link to post
Share on other sites

Ok, maybe not. I reran the OpenSCAD build step with the old library, no other changes. The thread height problem corrected itself, but otherwise I don't immediately see a substantial difference in the two sets of images.

One very obvious change is that the new library is WAY faster than the old one.




Share this post

Link to post
Share on other sites

Ok, now that I see two sets of pictures together I do see another difference, which is that the new library uses many more polygons than the old one (rounder cylinders). I always had a "high res" selection in OpenSCAD ($fs=0.4; $fa=2;), and it looks like either the new lib honors this, or the new lib still overrides, but to a higher quality setting.


Share this post

Link to post
Share on other sites

How functional are these threads? I experimented with a few a while ago, to augment bolt retention. I came to the conclusion it was not really worth the hassle, it is much easier and more functional to just embed a nut and create a tunnel to it. Threads just seem not to be designed for these kinds of plastics.

I would love to hear your experiences, I might very well be overlooking some obvious gains.


Share this post

Link to post
Share on other sites

Well, they were perfectly functional for the application I had in mind, which was to live outdoors without rusting, but not have to bear much of a load. I'd say that they could compete with brass in strength terms, and outlast zinc plated steel. Plus I can make them any size I like.


Share this post

Link to post
Share on other sites

Okay, so based on what has been said here, I did some more testing:


  • I tried more of DonMilne's mentioned settings.
  • I tried the older library.
  • I tried M12 instead of M6.
  • I tried DonMilne's $fa and $fs.
  • I tried larger and smaller $fn.
  • I tried the Default profile in Expert mode. (Which is different than the Normal quickprint profile.) O_o
  • I scaled an M6 up 200% in Cura.
  • I tried different temperatures. (I was using 215 for the UM Silver) (Tried 200 and 190).
  • I switched to ColorFabb Ultra Marine Blue PLA/PHA (brand new!). Tried the M12 and 200% scale.
  • I compared various combination of the Fix Horrible settings.

*None* of that changed anything. :(

I was pretty much ready to throw in the towel here. And I super was bummed about it.

However, some observations and some learning:


  • The new library sets $fn to 30 as a global setting.
  • To override it, you need to pass $fn into the module call as an argument.
  • If $fn is set, $fa and $fs are totally ignored. (That's in the docs.)
  • Forcing $fn=0 lets you use $fa and $fs again.
  • The old library does not set $<anything>.
  • DonMilne's $fa and $fs settings seem to be about equal to $fn=60.
  • For me 215 C seems to give better bare-glass bed ahesion over 210 C.
  • Both the old and new libraries leave small spaces between each thread segment and also between the threads and the shaft. I am guessing this is to allow for precision plastic flow while printing, but that is a guess.

Lastly, looking at the different $f[asn] results in Cura's layer view, I think I see the problem. I just don't know how to fix it.

The threads are being sliced as a series of disconnected single or double squares, even with thicker shells. So the printer is just going blob, blob, blob, instead of a nice continuous line. I think this is the issue.

Maybe older versions of Cura merged the thread squares better. I don't know. But that would explain why it worked a year ago and not now.

So, now, in a last bit of desparation before I give up, I noticed that there is a "newer" old version of the library (ISOThread_20120823.scad) and it looks like it automatically adjusts $fn and thread quality based on the given diameter. Trying this version, reduced the number of thread and shaft segments, but Cura actually sliced it more continuously and more closely packed.

Printing this version of an M6 seemes to have worked quite nicely! So, YAY SUCCESS! :D

I will post some pics to help explain and show the results.

But the final answer seems to be to lower $fn and number of thread segments so that Cura can slice it more seemlessly. I think Cura has changed and has become less forgiving in it's interaction with this library.

Now with this new insight, I will have to see if I can get good results with the new library. Low poly FTW! Counter-intuitive! ... (Unless I am wrong.) :p

Many thanks for all the help! I am super happy now!

(Sorry for the massive post!)


Share this post

Link to post
Share on other sites

Here are the pics.

The fails:

failed bolts 2


failed bolts 3


One can see the issue with the way Cura 15.02.1 slices the threads. They print like that too. lob, blob, blob. Not continuous.


failed bolts 4


failed bolts 5

The success:

success bolt 1

success bolt 2


Lower shaft side count and lower thread segment count leads to better/smoother slicing.


success bolt 3


success bolt 4

I hope this helps others trying to print threads! :D


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Our picks

    • Ultimaker Cura | a new interface
      We're not only trying to always make Ultimaker Cura better with the usual new features and improvements we build, but we're also trying to make it more pleasant to operate. The interface was the focus for the upcoming release, from which we would already like to present you the first glance. 
        • Like
      • 114 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!