Fix $fn handling in circle_outer
This commit is contained in:
parent
3c369eaa75
commit
4a6efa9384
|
@ -85,14 +85,14 @@ module screw_hole_lobe(ID, OD, lobes=3) {
|
||||||
|
|
||||||
module circle_outer(d) {
|
module circle_outer(d) {
|
||||||
// Regular circle inscribes, this circumscribes
|
// Regular circle inscribes, this circumscribes
|
||||||
$fn = is_undef($fn) ? 72 : $fn;
|
$fn = (is_undef($fn) || $fn<3) ? 72 : $fn;
|
||||||
fudge = 1/cos(180/$fn);
|
fudge = 1/cos(180/$fn);
|
||||||
circle(d=d*fudge);
|
circle(d=d*fudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
module cylinder_outer(d, h, center=false) {
|
module cylinder_outer(d, h, center=false) {
|
||||||
// Regular circle inscribes, this circumscribes
|
// Regular circle inscribes, this circumscribes
|
||||||
$fn = is_undef($fn) ? 72 : $fn;
|
$fn = (is_undef($fn) || $fn<3) ? 72 : $fn;
|
||||||
fudge = 1/cos(180/$fn);
|
fudge = 1/cos(180/$fn);
|
||||||
cylinder(d=d*fudge, h=h, center=center);
|
cylinder(d=d*fudge, h=h, center=center);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue