Merging PR #42 by bvarner

Add a tap() module which creates tapped holes by differencing
the tap() from some parent-part.
This commit is contained in:
Adrian Schlatter 2020-08-03 15:13:46 +02:00
commit 53944df3fa
2 changed files with 27 additions and 1 deletions

12
tests/taptest.scad Normal file
View File

@ -0,0 +1,12 @@
use <threadlib/threadlib.scad>;
intersection() {
union() {
difference() {
cylinder(r = 15, h = 20);
tap("G1/2", 8);
}
bolt("G1/2", 8);
}
cube([20, 20, 20]);
}

View File

@ -4,7 +4,7 @@ threadlib
Create threads easily.
:Author: Adrian Schlatter
:Author: Adrian Schlatter and contributors
:Date: 2019-11-11
:License: 3-Clause BSD. See LICENSE.
*/
@ -62,3 +62,17 @@ module nut(designator, turns, Douter, higbee_arc=20, fn=120, table=THREAD_TABLE)
};
};
};
module tap(designator, turns, higbee_arc=20, fn=120, table=THREAD_TABLE) {
difference() {
specs = thread_specs(str(designator, "-int"), table=table);
P = specs[0]; Dsupport = specs[2];
H = (turns + 1) * P;
translate([0, 0, -P / 2]) {
cylinder(h=H, d=Dsupport, $fn=fn);
};
thread(str(designator, "-int"), turns=turns, higbee_arc=higbee_arc, fn=fn, table=table);
};
}