1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 09:44:16 +02:00
This commit is contained in:
Justin Lin
2022-04-18 22:22:21 +08:00
parent a0e465a635
commit 96432c8525

View File

@@ -19,13 +19,11 @@ function bauer_spiral(n, radius = 1, rt_dir = "CT_CLK") =
[ [
for(k = 1; k <= n; k = k + 1) for(k = 1; k <= n; k = k + 1)
let( let(
zk = 1 - (2 * k - 1) / n, z = 1 - (2 * k - 1) / n,
phik = radians(acos(zk)), sin_phi = sqrt(1 - z ^ 2),
thetak = L * phik * clk, theta = clk * L * acos(z),
phikDegrees = degrees(phik), x = sin_phi * cos(theta),
thetakDegrees = degrees(thetak), y = sin_phi * sin(theta)
xk = sin(phikDegrees) * cos(thetakDegrees),
yk = sin(phikDegrees) * sin(thetakDegrees)
) )
[xk, yk, zk] * radius [x, y, z] * radius
]; ];