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
The specification comes from
The modules file is downloadable here.
(Right-click and Save Link As...)
There are two front-end modules:
metric_thread (diameter, pitch, length)
english_thread (diameter, threads_per_inch, length)
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
Indicates that an internal thread (e.g., for a nut) will be drawn.
Internal threads should be "cut out" from a solid using
The default (internal=false) indicates that external threads
(e.g., for a bolt) will be drawn.
(The clearances for internal and external threads are different.
This provides the option to draw multi-start threads.
These have two or more "parallel grooves" for the threads. For example,
the DNA double-helix has two "starts".
I used this option to
create a sprocket
for a Rohloff 14-speed bicycle hub, which has a proprietary six-start
square=true. (default: false). Standard square threads (per
thread_size=N. (default: same as pitch). Non-standard. This option allows the
size of a single thread "V" to be specified independently of the pitch
("travel" per turn). In this example, the pitch is 4 mm, but the thread size is 1 mm.
groove=true. (default: false) Non-standard. Draws the thread as an
inverted "V" subtracted from the "bolt cylinder". In this example, the pitch is 4 mm and the
thread size is 1 mm (as in the previous example), but groove is set true.
rectangle=RATIO. (default: 1). Non-standard. Specifies a "square" thread that is
actually a rectangle. In this example, rectangle=0.333 - the "height" of the thread is
one-third of its "width." In addition, the pitch is 8 mm while the
thread size is 6 mm, and groove is set to true.
angle=DEG (default: 30). Non-standard. Specifies the angle of the
thread side measured from a line perpendicular to the thread axis.
The default 30 degrees is the ISO standard.
taper=diameter/length (default: 0). The amount of taper as change
in diameter per length. The NPT standard is 1 inch change in diameter
per 16 inches length.
Note: left-hand threads. While there is no option for left-hand threads, such
"reverse" threads are easy to create in OpenSCAD – use the
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).
me if you have any questions or suggestions.