1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-20 05:21:38 +02:00
This commit is contained in:
Justin Lin
2020-10-25 14:43:33 +08:00
parent a307fcd565
commit f2052b09d3

View File

@@ -1,12 +1,12 @@
function fibonacci_sphere(samples) =
function fibonacci_sphere(n) =
let(
toDegrees = 180 / PI,
phi = PI * (3 - sqrt(5))
)
[
for(i = [0:samples - 1])
for(i = [0:n - 1])
let(
y = 1 - (i / (samples - 1)) * 2,
y = 1 - (i / (n - 1)) * 2,
radius = sqrt(1 - y * y),
theta = phi * i,
x = cos(theta * toDegrees) * radius,