1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-07 15:26:39 +02:00

extracted out __frags

This commit is contained in:
Justin Lin
2017-05-07 09:41:51 +08:00
parent 5e410c3e6f
commit 0970987629
2 changed files with 6 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
function __frags(radius) = $fn > 0 ?
($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, radius * 6.28318 / $fs), 5);

View File

@@ -12,11 +12,11 @@
*
**/
include <__private__/__frags.scad>;
function circle_path(radius, n) =
let(
_frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, radius * 6.28318 / $fs), 5),
_frags = __frags(radius),
step_a = 360 / _frags,
end_a = 360 - step_a * ((n == undef || n > _frags) ? 1 : _frags - n + 1)
)