diff --git a/global_defs.scad b/global_defs.scad index d93f16d..f7f635a 100644 --- a/global_defs.scad +++ b/global_defs.scad @@ -35,6 +35,7 @@ cnc_bit_r = is_undef($cnc_bit_r) ? 1.2 : $cnc_bit_r; // min show_rays = is_undef($show_rays) ? false : $show_rays; // show camera sight lines and light direction show_threads = is_undef($show_threads) ? false : $show_threads; // show screw threads show_plugs = is_undef($show_plugs) ? false : $show_plugs; // plugs on headers +teardrop_angle = is_undef($teardrop_angle) ? 45 : $teardrop_angle; // teardrop angle pp1_colour = is_undef($pp1_colour) ? rr_green : $pp1_colour;// printed part colour 1, RepRap logo colour pp2_colour = is_undef($pp2_colour) ? crimson : $pp2_colour;// printed part colour 2 pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour;// printed part colour 3 diff --git a/utils/core/teardrops.scad b/utils/core/teardrops.scad index 9705517..f322546 100644 --- a/utils/core/teardrops.scad +++ b/utils/core/teardrops.scad @@ -34,15 +34,18 @@ module teardrop(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_ mirror([side, 0, 0]) intersection() { hull() - translate([offset, 0]) { - circle4n(R); + translate([offset, 0]) { + circle4n(R); - if(truncate) - translate([0, R / 2]) - square([2 * R * (sqrt(2) - 1), R], center = true); - else - polygon([[0, 0], [eps, 0], [0, R * sqrt(2)]]); - } + if (teardrop_angle > 0) { + x = R * tan(teardrop_angle / 2); + if(truncate) + translate([0, R / 2]) + square([2 * x, R], center = true); + else + polygon([[0, 0], [eps, 0], [0, R + x * tan(min(teardrop_angle, 90 - eps))]]); + } + } translate([0, -2 * R]) square([R, 4 * R]); }