1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-01-16 21:18:15 +01:00

Allow configuration of teardrop angle.

This commit is contained in:
Martin Budden 2021-12-11 09:34:49 +00:00
parent 59c3f984c5
commit 8682d0a470
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -37,11 +37,14 @@ module teardrop(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_
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 = sin(teardrop_angle) - (1 - cos(teardrop_angle)) / tan(teardrop_angle);
if(truncate)
translate([0, R / 2])
square([2 * R * x, R], center = true);
else
polygon([[0, 0], [eps, 0], [0, R * (1 + x * tan(min(teardrop_angle, 90 - eps)))]]);
}
}
translate([0, -2 * R])
square([R, 4 * R]);