Thread-drawing modules for OpenSCAD

Updated 2016-12-04. Added default chamfer ("lead-in") and "leadin" option to change.

Here are modules to draw accurate, ISO-standard threads in OpenSCAD. The specification comes from Wikipedia.

OpenSCAD modules

The modules file is downloadable here. (Right-click and Save Link As...)

There are two front-end modules:

metric_thread() input units are millimeters. english_thread() inputs are in inches, though the drawing dimensions are in millimeters.

There are several optional parameters that can be used with either of these modules:

Note: left-hand threads. While there is no option for left-hand threads, such "reverse" threads are easy to create in OpenSCAD – use the "mirror" command to "flip" the part across a plane.

This module, which uses a polyhedron for each segment of the thread, was inspired by Trevor Moseley's work, although the results there do not appear to adhere to the ISO standards (especially with regard to required clearances).

Please contact me if you have any questions or suggestions.