Create a [Thread] object, and customise it as you wish, then use it to
create [Nut]s, [Bolt]s, [ThreadedRod]s, [ThreadedHole]s and [Washer]s.
All classes are immutable, but are still customisable. Each `customisation` method
returns a new instance.
_Threads_
The [Threads] class contains the dimensions used by the Shape3d classes
([Nut], [Bolt], [ThreadedRod], [ThreadedHole]).
All male threads are created by [ThreadedRod], and all female threads by [ThreadedHole].
They use the same [Shape2d] to create both types of thread, but the female thread is
swept out around a cylinder which is slightly wider than the male thread.
See [Thread.clearance].
Therefore, even if we ignore overhangs, it is impossible to create threads with a square
profile.
The default clearance is 0.5mm for thread diameters >= 5mm,
and proportially smaller for smaller diameter threads.
The default thread shape is a trapisoid, with 45° angles. I chose this, because it it
likely to be easy to print on consumer grade printers, without needing small layer heights.
I can print 4mm threads on a cheap printer with a 0.4mm nozzle and 0.2mm layer height.
No attempt has been made to mimic standard threads, though at some point, I may.
_Lock Nuts_
I wonder if lock nuts could be created by printing a nut with PLA at the bottom
using the default clearance, and then TPU at the top with smaller (or even zero)
clearance at the top?
_BEWARE_
If the thread self-intersects, then it won't form a valid model. Generating the .stl will fail.
(Parts will be missing).
So ensure that the #pitch > threadSize.y#.
A warning will be issued in the log if it detects this problem.
_Metal Bolts_
This extension was fun to write, and somewhat useful, but I still use off the shelf
metal bolts more often than plastic ones.
Threaded inserts, captured nuts, or even using a tap to cut a thread in a
cylindrical hole in plastic will usually give better results.
Also consider using off the shelf metal bolts, and adding plastic knobs,
which allows them to be screwed in by hand (tool-free).
See [Thread.boltKnob()] and Examples -> `BoltKnobs`.