From 1b73bd8eae1c26ad1d12fbf0483437190b259bdf Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Sun, 29 Sep 2019 23:13:45 -0400 Subject: [PATCH] acorn: make cap dome height parametric Minimal support for alternative cap models. --- acorn/acorn-threads.scad | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/acorn/acorn-threads.scad b/acorn/acorn-threads.scad index 688ef30..7173ae5 100644 --- a/acorn/acorn-threads.scad +++ b/acorn/acorn-threads.scad @@ -35,6 +35,7 @@ module acorn (thread_pitch = 3.0, base_height = AUTO_CALCULATE, wall_thickness = AUTO_CALCULATE, outer_d = AUTO_CALCULATE, + dome_h = AUTO_CALCULATE, keychain = true) { @@ -110,9 +111,9 @@ module acorn (thread_pitch = 3.0, } if (keychain) cap_keychain_holes (); - // hollow it out (make parametric later, this is pretty ugly now, but calc seems to be ok for RaleighAcorn) + // hollow the cap out (make parametric later, this is pretty ugly now, but calc seems to be ok for RaleighAcorn) diam_to_height_ratio = 3.2; - dome_h = outer_d / diam_to_height_ratio - thread_height; + dome_h = (dome_h == AUTO_CALCULATE) ? outer_d / diam_to_height_ratio - thread_height : dome_h; echo ("dome_h = ", dome_h); difference () { translate ([0, 0, thread_height-0.01]) dome (d=outer_d, h=dome_h); -- 2.20.1