This is yet another open-scad library to create threads...
No, wait! This is intended to be extremely fast and easy to use!
Few lines of code create a spirally set of points and the corresponding faces, creating a single polyhedron.
Standalone it renders extremely fast, combined with other objects/functions (difference etc...) it gets slowed down due to the large amount of facets representing the thread and the corresponding intersections.
!! Openscad version 2016.xx or newer required!!! (I use the "nightly-builds" i.e. "Development Snapshots" - see: http://www.openscad.org/downloads.html)
The file itself includes an example call of the module, it is simply: s_thread(diameter, threadpitch, height)
It follows the general setting of "$fn", it can be set globally or individually.
Give it a try and have fun!
Note: The height of the thread cannot be set seamlessly, it rounds the given value to a multiple of the threadpitch a.k.a whole number of turns.