From 2021b75cebcf239010e28df8e9483101fdd8eb33 Mon Sep 17 00:00:00 2001 From: Bryan Varner <1652015+bvarner@users.noreply.github.com> Date: Wed, 8 Jul 2020 11:02:22 -0400 Subject: [PATCH] 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. --- threadlib.scad | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/threadlib.scad b/threadlib.scad index 132efb5..b94a08a 100644 --- a/threadlib.scad +++ b/threadlib.scad @@ -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); + }; +}