Cleaned up separating into functional sections and adding comments.
You can now chose Rolson or Fairbury wrench (spanner) sizes.
Much faster rendering (details in Instructions).
OpenSCAD 2014.03 has modified polyhedron() command. Use ISOThread.scad to avoid getting 'deprecated' messages, use ISOThreadLeg.scad (Legacy version) for all earlier versions of OpenSCAD.
top of file includes calls to make bolts: M10x16, M8x16, M6x12 nuts: M10, M8, M6. simply un-comment 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.
This new version is much more modular, it easily allows non ISO thread pitches to be used (functions thread_in_pitch and thread_out_pitch).
Set variable WrenchSizes=0 to get Rolson nut / bolt head sizes as previous version, set WrenchSizes=1 to get Fairbury nut / bolt head sizes (as suggested by obijuan).
This version is much faster to render, many thanks to Tafka - clever guy, I used his suggestion, threads are assembled in turns and parts of a turn, OpenSCAD caching loves it.
Tests using Windows 7 Home Premium 64 bit with $fn=30
Previous 23/08/2012 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
New 20/04/2014 (Leg or std):
-- M10 nut = 4 secs
-- M8 nut = 6 secs
-- M6 nut = 5 secs
-- M10x16 = 18 secs
-- M8x16 = 25 secs
-- M6x12 = 23 secs
Please use as you wish and enjoy :-)