1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 18:24:28 +02:00

you can get the number of points now.

This commit is contained in:
Justin Lin
2017-04-25 10:03:57 +08:00
parent 4bef805d5d
commit ab45ff5032

View File

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