mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-17 12:10:47 +02:00
added torus_knot
This commit is contained in:
11
src/torus_knot.scad
Normal file
11
src/torus_knot.scad
Normal 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]
|
||||||
|
];
|
Reference in New Issue
Block a user