mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-14 02:34:12 +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)
|
for(k = 1; k <= n; k = k + 1)
|
||||||
let(
|
let(
|
||||||
z = 1 - (2 * k - 1) / n,
|
z = 1 - (2 * k - 1) / n, // cos_phi
|
||||||
sin_phi = sqrt(1 - z ^ 2),
|
sin_phi = sqrt(1 - z ^ 2),
|
||||||
theta = clk * L * acos(z),
|
theta = clk * L * acos(z)
|
||||||
x = sin_phi * cos(theta),
|
|
||||||
y = sin_phi * sin(theta)
|
|
||||||
)
|
)
|
||||||
[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])
|
for(i = [0:n - 1])
|
||||||
let(
|
let(
|
||||||
z = 1 - (2 * i + 1) / n,
|
z = 1 - (2 * i + 1) / n, // cos_phi
|
||||||
r = sqrt(1 - z ^ 2),
|
sin_phi = sqrt(1 - z ^ 2),
|
||||||
theta = phi * i * clk,
|
theta = clk * i * degrees(phi)
|
||||||
deg = degrees(theta)
|
|
||||||
)
|
)
|
||||||
[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