1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-01 04:20:27 +02:00

refactored

This commit is contained in:
Justin Lin
2017-04-22 17:18:53 +08:00
parent faae2c7603
commit 5a39e75ade

View File

@@ -12,15 +12,14 @@
*
**/
function circle_path(radius) =
let(
_frags = $fn > 0 ?
($fn >= 3 ? $fn : 3) :
max(min(360 / $fa, radius * 2 * 3.14159 / $fs), 5)
max(min(360 / $fa, radius * 2 * 3.14159 / $fs), 5),
step_a = 360 / _frags
)
[
for(a = [0 : 360 / _frags : 360 - 360 / _frags])
for(a = [0 : step_a : 360 - step_a])
[radius * cos(a), radius * sin(a)]
];