mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-12 09:44:16 +02:00
refactor
This commit is contained in:
@@ -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
|
||||||
];
|
];
|
Reference in New Issue
Block a user