Let me introduce to the awesomness of the BOSL2 screw module:

https://github.com/BelfrySCAD/BOSL2/wiki/screws.scad

This is amazing but the first time I needed to make a screw I needed to make one that used the NPT standard which this module still does not cover :)