Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First try at Glass Packaging Institute threads #78

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ design: clean
cat design/PCO_thread.csv | awk -f design/PCO_thread.awk >> design/THREAD_TABLE.csv
cat design/UIS_thread.csv | awk -f design/UIS_thread.awk >> design/THREAD_TABLE.csv
cat design/microscope_thread.csv | awk -f design/microscope_thread.awk >> design/THREAD_TABLE.csv
cat design/GPI_thread.csv | awk -f design/GPI_thread.awk >> design/THREAD_TABLE.csv
cat design/THREAD_TABLE.csv | awk -f design/autogenerate.awk > THREAD_TABLE.scad

.PHONY: test
Expand Down
4 changes: 4 additions & 0 deletions THREAD_TABLE.scad
Original file line number Diff line number Diff line change
Expand Up @@ -1901,4 +1901,8 @@ THREAD_TABLE = [["G1/16-ext", [0.907, 3.1631, 6.3625, [[0, -0.4252], [0, 0.4252]
["32-UN-13/16-int", [0.79375, -10.3492, 20.6914, [[0, 0.3473], [0, -0.3473], [0.4296, -0.0992], [0.4296, 0.0992]]]],
["RMS-ext", [0.7056, 9.5829, 19.1859, [[0.0, -0.3274], [0.0, 0.3273], [0.4932, 0.0706], [0.4932, -0.0706]]]],
["RMS-int", [0.7055, -10.3042, 20.5085, [[0.0, 0.2630], [0.0, -0.2630], [0.4808, -0.0127], [0.4808, 0.0127]]]],
["GPI-33-ext", [4.233, 14.72, 29.44 , [[ 0, -1.20], [0, 1.20], [ 1.20, 0.60], [1.20, -0.60]]]],
["GPI-33-int", [4.233, -16.455, 32.91 , [[ 0, 1.20 ], [0, -1.20], [1.20, -0.60], [1.20, 0.60]]]],
["GPI-63-ext", [4.233, 29.72, 59.44 , [[ 0, -1.20], [0, 1.20], [ 1.20, 0.60], [1.20, -0.60]]]],
["GPI-63-int", [4.233, -31.955, 63.91 , [[ 0, 1.20 ], [0, -1.20], [1.20, -0.60], [1.20, 0.60]]]],
];
4 changes: 4 additions & 0 deletions design/GPI_thread.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/^[^#]/ {
print $0;
}

5 changes: 5 additions & 0 deletions design/GPI_thread.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Designator,Pitch,Rrot,Dsupport,r0,z0,r1,z1,r2,z2,r3,z3
GPI-33-ext,4.233,14.72, 29.44 , 0, -1.20,0, 1.20, 1.20, 0.60,1.20,-0.60
GPI-33-int,4.233,-16.455, 32.91 , 0, 1.20 ,0, -1.20,1.20,-0.60,1.20,0.60
GPI-63-ext,4.233,29.72, 59.44 , 0, -1.20,0, 1.20, 1.20, 0.60,1.20,-0.60
GPI-63-int,4.233,-31.955, 63.91 , 0, 1.20 ,0, -1.20,1.20,-0.60,1.20,0.60
38 changes: 35 additions & 3 deletions tests/test_table.awk
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,40 @@ BEGIN {
NR_OF_TESTS += 2;
}

/(G.+-ext)|(RMS-ext)/ {
# ext G- and RMS threads have +/-62.5 deg slopes, horizontal crest / valley
/GPI-.+-ext/ {
# ext GPI threads have +/-63.4349 deg slopes, horizontal crest / valley
parse();
m1 = slope(v0, v3) / deg;
m2 = slope(v2, v1) / deg;
if (m1 > 63.4349 + dphi || m1 < 63.4349 - dphi \
|| m2 < -63.4349 - dphi || m2 > -63.4349 + dphi) {
print designator " FAIL: " m1 ", " m2 " deg";
PASS = 0;
}
test_horizontal();
tested = 1;
NR_OF_TESTS += 2;
}

# Todo - Fix this angle test for GPI
/GPI-.+-int/ {
# int GPI threads have +/-63.4349 deg slopes, horizontal crest / valley
parse();
m1 = slope(v3, v0) / deg;
m2 = slope(v1, v2) / deg;
if (m1 > -63.4349 + dphi || m1 < -63.4349 - dphi \
|| m2 < 63.4349 - dphi || m2 > 63.4349 + dphi) {
print designator " FAIL: " m1 ", " m2 " deg";
PASS = 0;
}
test_horizontal();
tested = 1;
NR_OF_TESTS += 2;
}


/G[^A-Z]+-ext|(RMS-ext)/ {
# ext M threads have +/-62.5 deg slopes, horizontal crest / valley
parse();
m1 = slope(v0, v3) / deg;
m2 = slope(v2, v1) / deg;
Expand All @@ -122,7 +154,7 @@ BEGIN {
NR_OF_TESTS += 2;
}

/(G.+-int)|(RMS-int)/ {
/(G[^A-Z]+-int)|(RMS-int)/ {
# int G- and RMS threads have +/-62.5 deg slopes, horizontal crest / valley
parse();
m1 = slope(v3, v0) / deg;
Expand Down