mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
c-style for loop
This commit is contained in:
@@ -8,14 +8,16 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
function torus_knot(p, q, phi_step) = [
|
function torus_knot(p, q, phi_step) =
|
||||||
for(phi = [0:phi_step:PI * 2])
|
let(tau = PI * 2)
|
||||||
let(
|
[
|
||||||
degree = phi * 180 / PI,
|
for(phi = 0; phi < tau; phi = phi + phi_step)
|
||||||
r = cos(q * degree) + 2,
|
let(
|
||||||
x = r * cos(p * degree),
|
degree = phi * 180 / PI,
|
||||||
y = r * sin(p * degree),
|
r = cos(q * degree) + 2,
|
||||||
z = -sin(q * degree)
|
x = r * cos(p * degree),
|
||||||
)
|
y = r * sin(p * degree),
|
||||||
[x, y, z]
|
z = -sin(q * degree)
|
||||||
];
|
)
|
||||||
|
[x, y, z]
|
||||||
|
];
|
Reference in New Issue
Block a user