In trying to convert some of my existing openscad projects over to this module

I ran across the mental block of adding interior threads to a pre-cut hollow, which broke my brain a bit.

I find it more natural to think of adding a threaded hole to a solid as a 'tap' or difference() operation, rather than differencing a hollow and then adding interior threads to it.

For this reason I've created the, `tap(...)` module, which creates a positive of the internal threads suitable for differencing to produce a threaded tap hole.
This commit is contained in:
Bryan Varner
2020-07-08 11:02:22 -04:00
parent 21af7ca550
commit 2021b75ceb

View File

@@ -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);
};
}