Loading

OpenSCAD ISO metric thread library / functions

by TrevM, published

OpenSCAD ISO metric thread library / functions by TrevM Jul 21, 2012

Description

Allows creation of standard nuts and bolts or allow threads to be included in projects.

Recent Comments

view all

hex_nut(19);

Is what I think you need.
With metric threads you basically need thread metric diameter and pitch (distance between threads).
You have diameter, you measured that as 19 mm.
Problem is pitch, you measured 13 threads per inch, = 13 threads in 25.4 mm = pitch of 1.95 mm.

Look in my .scad file, you will see:
// function for thread pitch
function get_coarse_pitch(dia) = lookup(dia, [
[1,0.25],[1.2,0.25],[1.4,0.3],[1.6,0.35],[1.8,0.35],[2,0.4],[2.5,0.45],[3,0.5],[3.5,0.6],[4,0.7],[5,0.8],[6,1],[7,1],[8,1.25],[10,1.5],[12,1.75],[14,2],[16,2],[18,2.5],[20,2.5],[22,2.5],[24,3],[27,3],[30,3.5],[33,3.5],[36,4],[39,4],[42,4.5],[45,4.5],[48,5],[52,5],[56,5.5],[60,5.5],[64,6],[78,5]]);

See in the middle: [18,2.5],[20,2.5]

ISO threads do not normally support 19 mm and standard pitch would be 2.5 mm.
But, just add [19,1.95] and it should work.

Ok, my fault, I suppose that I should restate the issue. Using a thread gauge that I have with my tap and die set, I was able to determine that the thread size is 13 (13 threads/inch). I need to make a nut that is 13 threads/inch with the nut having internal diameter of 19 mm so that it will fit onto the shower head.

Sorry for the confusion.

Um, your problem does not compute!
hex_nut(13);
will give you a standard ISO 13 mm thread
hex_bolt(13,20);
will give you a standard ISO 13 mm bolt that is 20 mm long
All threads have a coarseness index, that is how deep the grooves are, which also relates to pitch (length between 1 ridge and the next).
Most ISO threads are either fine or coarse, at 13 mm you are usually saying thread is 0.75 mm or 1 mm respectively.
But normally the threaded part of a 13 mm bolt has outside diameter of 13 mm + coarse (13.75 or 14 mm) and inside diameter of a 13 mm nut is 13 mm - coarse (12.25 mm or 12 mm ).
So 13 mm thread with an inside diameter of 19 mm is not possible.

More from 3D Printer Accessories

view more

Makes

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

top of file includes calls to make bolts: M10x16, M8x16, M6x12 nuts: M10, M8, M6. simply uncomment a line and build then print, or create your own sizes or include into your own project so you can have threads.
Photos should show black and white nuts and bolts in M6, M8 and M10 sizes, black versions are standard bought steel, white versions are ones I printed in white ABS.
I have a Reprap Metric Mendel Prusa with LM8UU bearings, fishbone wade extruder, own design hot-end, MKII hot bed. Only got it going yesterday, not yet calibrated awaiting micrometer from ebay.
This is my first design in OpenSCAD, maths in not my strong point, but I think these are as close to accurate ISO Metric as I can get.

Hot-end has 0.5mm extrusion hole, used 0.2mm layers, I had to go down to 5mm/s speed to get these printed, I have not yet tried smaller sizes.

OK, so that was a shock, knocked up the original file quickly for self-use, uploaded as an after thought, did not expect that much interest!
There have been some concerns with CGAL rendering times with bolts.
So, see new version IsoThread_20120823.scad.
I have moved positional calculations into variables to they are now calculated only one per thread part and I have now included quality tables.

Results:
CGAL Rendering times
DELL Vostro Desktop - Intel i5-2400 @ 3.10 GHz - 16GB RAM

Original 15/07/2012
Windows 7 Home Premium - OpenSCAD 2012.04.01 (git c869c6e):
M10 nut 7 secs
M8 nut 9 secs
M6 nut 4 secs
M10x16 5 mins 35 secs
M8x16 8 mins 43 secs
M6x12 7 mins 27 secs
Ubuntu 10.04 LTS - OpenSCAD 2012.02.28:
M10 nut 4 secs
M8 nut 4 secs
M6 nut 2 secs
M10x16 2 mins 52 secs
M8x16 4 mins 36 secs
M6x12 3 mins 45 secs

New 23/08/2012
Windows 7 Home Premium - OpenSCAD 2012.04.01 (git c869c6e):
M10 nut 9 secs
M8 nut 10 secs
M6 nut 3 secs
M10x16 2 mins 16 secs
M8x16 2 mins 7 secs
M6x12 1 mins 4 secs

I may re-visit again later, I have an idea that 'may' work that could make it faster.

Comments

You must be logged in to post a comment.

gwfami on Dec 8, 2013 said:

I need to use this to make a nut and bolt that are thread size 13 with the nut's internal diameter 19mm (to fit shower head). What do I input for this?

TrevM on Dec 9, 2013 said:

Um, your problem does not compute!
hex_nut(13);
will give you a standard ISO 13 mm thread
hex_bolt(13,20);
will give you a standard ISO 13 mm bolt that is 20 mm long
All threads have a coarseness index, that is how deep the grooves are, which also relates to pitch (length between 1 ridge and the next).
Most ISO threads are either fine or coarse, at 13 mm you are usually saying thread is 0.75 mm or 1 mm respectively.
But normally the threaded part of a 13 mm bolt has outside diameter of 13 mm + coarse (13.75 or 14 mm) and inside diameter of a 13 mm nut is 13 mm - coarse (12.25 mm or 12 mm ).
So 13 mm thread with an inside diameter of 19 mm is not possible.

Tafka on Nov 21, 2013 said:

One way I found to speed this library up is to generate shorter lengths (just a couple of turns of the threads), then duplicate this shape and translate and rotate it a bit so it forms the next part of the thread. Keep doing this a few times and you end up with a longer thread which renders quite quickly. Each generated section is cached then reused, so it is much quicker. One quick calculation I did showed that a render I was attempting would have taken 3 years (as the time goes up geometrically). However, I got it down to a few minutes.

TrevM on Dec 9, 2013 said:

Nice one, thanks for sharing, will try that myself :-)

padorange on Aug 3, 2012 said:

Just try and i got a problem for rendering bold (nuts are fine)... bold compile but do not render (rendering seems to enter an infinite loop), so i can't make a STL.

Using OpenSCAD 2012.7.14 for MacOS.

TrevM on Aug 3, 2012 said:

This sounds like complexity problem, threads on nuts are quite short, threads on bolts are usually longer. The threads are made out of lots of polygons, trianguar on ends, rectangular on sides. Either wait and it will render, or look for line in ISOThread.scad:

module thread_out(dia,hi,thr=32)

3rd parameter is complexity, 32 means 32 polygons for each turn of thread, reduce this to 15 and try again, you should see the effect on a normal compile.

obijuan on Jul 28, 2012 said:

I have printed the M8 hex nut. The thread work perfect! but the diameter and height are wrong. I have changed them according to :

http://www.fairburyfastener.co...

and now the nuts are exactly as the metal ones :-) I have only tested the M8. The diameter and height I have changed in the openscad are:
* Diam: [8,14.60]
* Hi: [8,4.5]

Now they work perfectly wel with the hex key (#13)

Thank you very m
uch for your work! :-)

TrevM on Jul 29, 2012 said:

I know, standards are nice, but so many of them :-(

Threads were ok, Wikipedia shows the maths of ISO threads, but even there, the standards are not clear, coarse and fine, some sizes missing so added by France etc. I just put in all the coarse sizes.

Then I came to hex head sizes and I did actually find the fairbury fastener link and used it to create all the tables. Then I wanted to test, my son had a set of Rolson nuts and bolts M4 to M10 :-) The sizes of the Rolson nuts and bolts are different! So I modified the tables to reflect the Rolson sizes.

The photos show they now match, the black nuts and bolts are Rolson steel, the white are my printed white ABS versions.

But I specifically put all the important sizes in tables so they can be easily modified.

Have Fun :-)

obijuan on Jul 28, 2012 said:

It is amazing!!!! Thank you very much for sharing! :-)

obijuan on Jul 28, 2012 said:

I have just tested the M8 hex nut and it works great!!! Now we can use these nuts for the Prusa :-)

I have taken a video showing how well 2 Hex nuts are screwed on a threaded rod

http://www.youtube.com/watch?v...

Top