Fix $fn handling in circle_outer

This commit is contained in:
Luke Hubmayer-Werner 2025-02-12 12:52:08 +10:30
parent 3c369eaa75
commit 4a6efa9384
1 changed files with 2 additions and 2 deletions

View File

@ -85,14 +85,14 @@ module screw_hole_lobe(ID, OD, lobes=3) {
module circle_outer(d) {
// Regular circle inscribes, this circumscribes
$fn = is_undef($fn) ? 72 : $fn;
$fn = (is_undef($fn) || $fn<3) ? 72 : $fn;
fudge = 1/cos(180/$fn);
circle(d=d*fudge);
}
module cylinder_outer(d, h, center=false) {
// Regular circle inscribes, this circumscribes
$fn = is_undef($fn) ? 72 : $fn;
$fn = (is_undef($fn) || $fn<3) ? 72 : $fn;
fudge = 1/cos(180/$fn);
cylinder(d=d*fudge, h=h, center=center);
}