Full and short designators

List metric threads not only with their short
designator but also with full designator as
proposed by @uDude.
This commit is contained in:
Adrian Schlatter
2021-10-08 22:51:52 +02:00
parent dfe2266f44
commit 91eb1b0121
3 changed files with 1035 additions and 25 deletions

View File

@@ -194,6 +194,7 @@ for addition to threadlib!
Change Log Change Log
=========================== ===========================
- 0.3.x: List metric threads under short designator and full designator
- 0.3: Unified Inch Screw Threads (UNC, UNF, UNEF, 4-UN, 6-UN, 8-UN, 12-UN, - 0.3: Unified Inch Screw Threads (UNC, UNF, UNEF, 4-UN, 6-UN, 8-UN, 12-UN,
16-UN, 20-UN, 28-UN, and 32-UN. Fixed problem with PCO-1881-int. Fixed problem 16-UN, 20-UN, 28-UN, and 32-UN. Fixed problem with PCO-1881-int. Fixed problem
with G-ext threads . New build system. with G-ext threads . New build system.

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,7 @@ function min(x, y) {
function calculateThreadlibSpecs() { function calculateThreadlibSpecs() {
Designator = $3; Designator = $3;
DesignatorLong = $2;
P = $4; P = $4;
H = P / 2 / tan(phi / 2); H = P / 2 / tan(phi / 2);
DPitchExt = ($8 + $9) / 2; DPitchExt = ($8 + $9) / 2;
@@ -30,6 +31,34 @@ function calculateThreadlibSpecs() {
ZCrestInt = (DCrestInt - DPitchInt + H) / 2 * tan(phi / 2); ZCrestInt = (DCrestInt - DPitchInt + H) / 2 * tan(phi / 2);
} }
function printExternalThreadSpecs() {
printf P "," # pitch
printf "%.4f,", DValleyExt / 2 # Rrot
printf "%.4f,", DSupportExt # Dsupport
printf 0 "," # r0
printf "%.4f,", -ZValleyExt # z0
printf 0 "," # r1
printf "%.4f,", +ZValleyExt # z1
printf "%.4f,", (DCrestExt - DValleyExt) / 2 # r2
printf "%.4f,", +ZCrestExt # z2
printf "%.4f,", (DCrestExt - DValleyExt) / 2 # r3
printf "%.4f\n", -ZCrestExt; # z3
}
function printInternalThreadSpecs() {
printf P "," # pitch
printf "%.4f,", -DValleyInt / 2 # Rrot
printf "%.4f,", DSupportInt # Dsupport
printf 0 "," # r0
printf "%.4f,", +ZValleyInt # z0
printf 0 "," # r1
printf "%.4f,", -ZValleyInt # z1
printf "%.4f,", -(DCrestInt - DValleyInt) / 2 # r2
printf "%.4f,", -ZCrestInt # z2
printf "%.4f,", -(DCrestInt - DValleyInt) / 2 # r3
printf "%.4f\n", +ZCrestInt; # z3
}
BEGIN { BEGIN {
FS = "\t"; FS = "\t";
pi = atan2(0, -1); pi = atan2(0, -1);
@@ -41,31 +70,17 @@ BEGIN {
calculateThreadlibSpecs(); calculateThreadlibSpecs();
# External thread: # External thread:
printf Designator "-ext," # designator printf Designator "-ext," # designator such as "M4-ext"
printf P "," # pitch printExternalThreadSpecs();
printf "%.4f,", DValleyExt / 2 # Rrot
printf "%.4f,", DSupportExt # Dsupport printf DesignatorLong "-ext," # designator such as "M4x0.7-ext"
printf 0 "," # r0 printExternalThreadSpecs();
printf "%.4f,", -ZValleyExt # z0
printf 0 "," # r1
printf "%.4f,", +ZValleyExt # z1
printf "%.4f,", (DCrestExt - DValleyExt) / 2 # r2
printf "%.4f,", +ZCrestExt # z2
printf "%.4f,", (DCrestExt - DValleyExt) / 2 # r3
printf "%.4f\n", -ZCrestExt; # z3
# Internal thread: # Internal thread:
printf Designator "-int," # designator printf Designator "-int," # designator such as "M4-int"
printf P "," # pitch printInternalThreadSpecs();
printf "%.4f,", -DValleyInt / 2 # Rrot
printf "%.4f,", DSupportInt # Dsupport
printf 0 "," # r0
printf "%.4f,", +ZValleyInt # z0
printf 0 "," # r1
printf "%.4f,", -ZValleyInt # z1
printf "%.4f,", -(DCrestInt - DValleyInt) / 2 # r2
printf "%.4f,", -ZCrestInt # z2
printf "%.4f,", -(DCrestInt - DValleyInt) / 2 # r3
printf "%.4f\n", +ZCrestInt; # z3
}
printf DesignatorLong "-int," # designator such as "M4x0.7-int"
printInternalThreadSpecs();
}