mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-01 05:00:14 +02:00
Allow configuration of teardrop angle.
This commit is contained in:
@@ -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
|
||||||
|
@@ -37,11 +37,14 @@ module teardrop(h, r, center = true, truncate = true, chamfer = 0, chamfer_both_
|
|||||||
translate([offset, 0]) {
|
translate([offset, 0]) {
|
||||||
circle4n(R);
|
circle4n(R);
|
||||||
|
|
||||||
if(truncate)
|
if (teardrop_angle > 0) {
|
||||||
translate([0, R / 2])
|
x = sin(teardrop_angle) - (1 - cos(teardrop_angle)) / tan(teardrop_angle);
|
||||||
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 * 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])
|
translate([0, -2 * R])
|
||||||
square([R, 4 * R]);
|
square([R, 4 * R]);
|
||||||
|
Reference in New Issue
Block a user