mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 10:14:41 +02:00
refactor
This commit is contained in:
@@ -19,11 +19,9 @@ function bauer_spiral(n, radius = 1, rt_dir = "CT_CLK") =
|
||||
[
|
||||
for(k = 1; k <= n; k = k + 1)
|
||||
let(
|
||||
z = 1 - (2 * k - 1) / n,
|
||||
z = 1 - (2 * k - 1) / n, // cos_phi
|
||||
sin_phi = sqrt(1 - z ^ 2),
|
||||
theta = clk * L * acos(z),
|
||||
x = sin_phi * cos(theta),
|
||||
y = sin_phi * sin(theta)
|
||||
theta = clk * L * acos(z)
|
||||
)
|
||||
[x, y, z] * radius
|
||||
[sin_phi * cos(theta), sin_phi * sin(theta), z] * radius
|
||||
];
|
@@ -18,10 +18,9 @@ function fibonacci_lattice(n, radius = 1, dir = "CT_CLK") =
|
||||
[
|
||||
for(i = [0:n - 1])
|
||||
let(
|
||||
z = 1 - (2 * i + 1) / n,
|
||||
r = sqrt(1 - z ^ 2),
|
||||
theta = phi * i * clk,
|
||||
deg = degrees(theta)
|
||||
z = 1 - (2 * i + 1) / n, // cos_phi
|
||||
sin_phi = sqrt(1 - z ^ 2),
|
||||
theta = clk * i * degrees(phi)
|
||||
)
|
||||
[cos(deg) * r, sin(deg) * r, z] * radius
|
||||
[cos(theta) * sin_phi, sin(theta) * sin_phi, z] * radius
|
||||
];
|
Reference in New Issue
Block a user