From d3c26dfacad9bb6fede50df81707f5b53c1652db Mon Sep 17 00:00:00 2001 From: mebers200 Date: Fri, 9 Jul 2021 10:22:03 -0600 Subject: [PATCH] fixing squared_spherical dish to work with all sizes --- src/dishes/squared_spherical.scad | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/dishes/squared_spherical.scad b/src/dishes/squared_spherical.scad index fed06a7..30859b1 100644 --- a/src/dishes/squared_spherical.scad +++ b/src/dishes/squared_spherical.scad @@ -1,13 +1,21 @@ module squared_spherical_dish(width, height, depth, inverted=false) { chord = pow(pow(height / 2, 2) + pow(width / 2, 2),0.5); direction = inverted ? -1 : 1; - r=width / 3.5; + r=max(height,width,chord) / 5; + // ^^^^^ Nothing special about this code to figure out r. + // I just modeled up 1u, 1.25u, 1.5u, 2u, 2.25u, and 2.75u + // keys and messed around until I came up with something that + // looked reasonable for all key sizes. This just seems to work + // well for all sizes translate([-width / 2, -height / 2, 0 * direction]) { resize([width, height, depth]) hull() { - cube([width,height,0.001]); - translate([width/2, height/2, -chord]) + cube([chord,chord,0.001]); + // Use something larger in this translate than -depth + // (like -chord) if you want more of a defined circle + // in the keywell + translate([chord/2, chord/2, -depth]) sphere(r=r, $fn=64); } }