This is a backport of commit 9ddd493b from develop, with two changes:
- unrelated changes have not been back ported
- backwards compatibility was added
Note that the actual usage of the head value in pygear is wrong, though:
As it is added to the diameter (not the radius) it should have been added
twice. However, as the clearance suffers from the same bug, I choose to
stay consistent. A fix should address both, head and clearance, but this
is out of scope here.