Loading
Parkinbot

bolts, nuts, threaded rods - OpenSCAD library Threading.scad

by Parkinbot Jul 5, 2016
Download All Files

Thing Apps Enabled

Please Login to Comment

I am using OpenSCAD 2019-05 on a Mac and I get a host warnings: WARNING: len() parameter could not be converted, in file Naca_sweep.scad, line 118

When I try a simple test, (example #6) the threaded cylinder appears below the z axis and end up with a solid cylinder followed by the threaded cylinder.

Any suggestions on what is wrong with my configuration?

The problem is the new version 2019. They introduced a bunch new warnings and a stricter calling syntax. These changes break a lot of older code.
Just now I uploaded version updates for both libs. Have a try with them.

Wow, that was a fast update. Updated with both files and things work perfectly. Now on with designing.

Thank you for the excellent library and the quick fixes.

Simply Briiiiiiliant!!!!

These work AMAZING!

Thank you so much for this. I just finished a print, and threaded two items together perfectly. There was no resistance, snags, ext. It worked perfect! (it was for a cosplay prop if you wonder).

Also for others, the code is super clean, and easy to use. I have tried other code, and wasn't impressed by both the results, and the work it took to try and get the sizing right. But this, flawless!

This worked great for me (see the "made" section). Unfortunately I found that using the same parameters to both functions (threading and Threading) did not mate - I had to make the "bolt" threads about 1mm larger in diameter. But any way after a little tweaking of the diameter it works really really well. Very consistent. Very smooth. I was able to mate with mini mag-lite threads also for a different portion of my design. Got it right the first try once I learned not to believe the "d" parameter. No post processing needed on those fine (1.27mm pitch) threads.

Can you expound a bit on your findings for me. I'm still pretty new to openscad and stumbled upon this awesome library but I keep having issues when I print where I can't get the two parts to mate after printing. How did you specify bolt thread size (I might be misunderstanding, and I apologize!)

Thank you in advance for any insight you can share!

Obviously nuts and bolts must have the same pitch, but a different diameter in order to have some clearance. It depends on your printer (and slicer) how much offset from the nominal diameter you will need.
Look at the following code. It outputs some inner view for a properly paired M8 thread and nut. The total clearance is 0.4 mm.

pitch = 1.25; 
difference()
{
  union()
  {
     threading(pitch = pitch, d=7.8, windings=20, full=true); 
     translate([0,0,6*pitch])
     Threading(pitch = pitch, D=14.6, d=8.2, windings=5, full=true, $fn=6); 
  } 
  cube(20); 
}

Thank you for the reply! I really appreciate it, this completely clears it up for me, time to test what my printer is capable of now :3

How clean do these exactly print? I have been trying to find a good thread pattern with good detail and they are always broken up. I loaded these into Cura and am getting some mixed results (like the threading isn't actually smoothly connected on the outside)

I put some examples into the library. Try to render these first and what you see is what you get.

I just ran a test print with one of the bolts and really like the results I saw. The last library I had just didn't work for me, but this one looks much better.

maybe some1 can post a video like how to intercept a thread with a cylinder. itd help me out. #totalnewb

how can i use this i have no experience i need to resize a thread to join 2 pipes togeteher. plz help

update
learned how to change to different thread type, now plz how do i resize

look into the code. There a lots of examples how to call the main modules.
You can essentially specify a pitch, a diameter and the number windings. pitch times windings is the length. You can also intersect a threading with a cylinder of a certain height.

ok nvm i understood now i thought u meant tht u could add a smooth cylinder on top of the thread to make a base. thxs

Comments deleted.

can i intercept an acme thread with a cylinder sir

Sorry, but I can't teach you programming OpenSCAD here. Try to find a course and start to learn at least the basics.

intersection()
{
translate([0, 0, -2]) // 2 mm down for intersection
threading(pitch = 2, d=20, windings = 20, angle = 29); ;
cylinder(d=20, h=20); // height = 20 mm
}

Thank you. For others: this library works and it is fast. But if I want M8, it produces M6. Easy fix, but maybe worth looking into.

Thanks for your feedback. There was a buggy parameter in the code, so M8 came out as M7. I updated it now.

Thank you for the effort. This is very useful library.

Super. Works very well too.

Very cool. You might consider a different name though, as threads.scad already exists: http://dkprojects.net/openscad-threads/ (I have no relation)

Thanks. You are right. I renamed it to 'Threading.scad' now, which I anyway had chosen for development.