1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 17:54:18 +02:00

added torus_knot

This commit is contained in:
Justin Lin
2019-05-17 17:59:08 +08:00
parent 63dcbe259d
commit fafa551959

11
src/torus_knot.scad Normal file
View File

@@ -0,0 +1,11 @@
function torus_knot(p, q, phi_step) = [
for(phi = [0:phi_step:6.28318])
let(
degree = phi * 180 / 3.14159,
r = cos(q * degree) + 2,
x = r * cos(p * degree),
y = r * sin(p * degree),
z = -sin(q * degree)
)
[x, y, z]
];