mirror of
https://github.com/adrianschlatter/threadlib.git
synced 2025-08-13 20:04:09 +02:00
Release 0.3
Enhancements =========== - Unified Inch Screw Threads Fixes =========== - PCO-1881 internal (minor diameter was too small) - Dpitch problem with G-ext threads Improvements =========== - developer docs - build system - unit tests - user does not need to rotate internal threads by 180 deg anymore to fit external thread !! Incompatibel changes !! ==================== We take the liberty to do this while the major version is still 0: - internal thread is rotated by 180 deg (see improvements). nut() and bolt() are not affected by this
This commit is contained in:
66
design/BSPP_thread.awk
Normal file
66
design/BSPP_thread.awk
Normal file
@@ -0,0 +1,66 @@
|
||||
function tan(x) {
|
||||
return(sin(x) / cos(x))
|
||||
}
|
||||
|
||||
function calculateThreadlibSpecs() {
|
||||
Designator = $1;
|
||||
P = $3;
|
||||
H = P / 2 / tan(phi / 2);
|
||||
DMax = $5;
|
||||
DPitch = $6;
|
||||
DMin = $7;
|
||||
DPitchInt = DPitch + $9 / 2;
|
||||
DPitchExt = DPitch + $10 / 2;
|
||||
DMinInt = DMin + $14 / 2;
|
||||
DMaxExt = DMax + $15 / 2;
|
||||
DSupportExt = DPitchExt - 2 * 5 / 12 * H;
|
||||
DSupportInt = DPitchInt + 2 * 5 / 12 * H;
|
||||
DValleyExt = DPitchExt - 2 * 5 / 12 * H * qOverlap;
|
||||
DValleyInt = DPitchInt + 2 * 5 / 12 * H * qOverlap;
|
||||
DCrestExt = DMaxExt - tan((pi + phi) / 4) / 6 * (1 - sin(phi / 2));
|
||||
DCrestInt = DMinInt + tan((pi + phi) / 4) / 6 * (1 - sin(phi / 2));
|
||||
ZValley = 0.03125 * P;
|
||||
ZCrestExt = (DPitchExt + H - DCrestExt) / 2 * tan(phi / 2);
|
||||
ZCrestInt = (DCrestInt - DPitchInt + H) / 2 * tan(phi / 2);
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
FS = "\t";
|
||||
pi = atan2(0, -1);
|
||||
deg = pi / 180;
|
||||
phi = 55 * deg;
|
||||
qOverlap = 1.05;
|
||||
}
|
||||
|
||||
/^[^#]/ {
|
||||
calculateThreadlibSpecs();
|
||||
|
||||
# External thread:
|
||||
printf "G" Designator "-ext," # designator
|
||||
printf P "," # pitch
|
||||
printf "%.4f,", DValleyExt / 2 # Rrot
|
||||
printf "%.4f,", DSupportExt # Dsupport
|
||||
printf 0 "," # r0
|
||||
printf "%.4f,", -P / 2 + ZValley # z0
|
||||
printf 0 "," # r1
|
||||
printf "%.4f,", +P / 2 - ZValley # z1
|
||||
printf "%.4f,", (DCrestExt - DValleyExt) / 2 # r2
|
||||
printf "%.4f,", +ZCrestExt # z2
|
||||
printf "%.4f,", (DCrestExt - DValleyExt) / 2 # r3
|
||||
printf "%.4f\n", -ZCrestExt; # z3
|
||||
|
||||
# Internal thread:
|
||||
printf "G" Designator "-int," # designator
|
||||
printf P "," # pitch
|
||||
printf "%.4f,", -DValleyInt / 2 # Rrot
|
||||
printf "%.4f,", DSupportInt # Dsupport
|
||||
printf 0 "," # r0
|
||||
printf "%.4f,", +P / 2 - ZValley # z0
|
||||
printf 0 "," # r1
|
||||
printf "%.4f,", -P / 2 + ZValley # z1
|
||||
printf "%.4f,", -(DCrestInt - DValleyInt) / 2 # r2
|
||||
printf "%.4f,", -ZCrestInt # z2
|
||||
printf "%.4f,", -(DCrestInt - DValleyInt) / 2 # r3
|
||||
printf "%.4f\n", +ZCrestInt; # z3
|
||||
}
|
||||
|
Reference in New Issue
Block a user