1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-12 18:33:58 +02:00

Merge branch 'martinbudden-teardrop_angle'

This commit is contained in:
Chris Palmer
2021-12-14 21:35:37 +00:00
2 changed files with 12 additions and 8 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_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_threads = is_undef($show_threads) ? false : $show_threads; // show screw threads
show_plugs = is_undef($show_plugs) ? false : $show_plugs; // plugs on headers 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 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 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 pp3_colour = is_undef($pp3_colour) ? "SteelBlue" : $pp3_colour;// printed part colour 3

View File

@@ -34,15 +34,18 @@ module teardrop(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_
mirror([side, 0, 0]) mirror([side, 0, 0])
intersection() { intersection() {
hull() hull()
translate([offset, 0]) { translate([offset, 0]) {
circle4n(R); circle4n(R);
if(truncate) if (teardrop_angle > 0) {
translate([0, R / 2]) x = R * tan(teardrop_angle / 2);
square([2 * R * (sqrt(2) - 1), R], center = true); if(truncate)
else translate([0, R / 2])
polygon([[0, 0], [eps, 0], [0, R * sqrt(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]) translate([0, -2 * R])
square([R, 4 * R]); square([R, 4 * R]);
} }