1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-11 01:04:07 +02:00
This commit is contained in:
Justin Lin
2019-05-20 11:10:39 +08:00
parent 8722f971ba
commit 7d5e18ff8c
3 changed files with 37 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

37
docs/lib-torus_knot.md Normal file
View File

@@ -0,0 +1,37 @@
# torus_knot
Generate a path of [The (p,q)-torus knot](https://en.wikipedia.org/wiki/Torus_knot).
![torus_knot](images/lib-torus_knot-1.JPG)
## Parameters
- `p` : The p parameter of The (p,q)-torus knot.
- `q` : The q parameter of The (p,q)-torus knot.
- `phi_step` : The amount when increasing phi.
## Examples
include <shape_pentagram.scad>;
include <rotate_p.scad>;
include <polysections.scad>;
include <path_extrude.scad>;
include <torus_knot.scad>;
p = 2;
q = 3;
phi_step = 0.05;
star_radius = 0.5;
pts = torus_knot(p, q, phi_step);
shape_pentagram_pts = shape_pentagram(star_radius);
path_extrude(
shape_pentagram_pts,
concat(pts, [pts[0]]),
closed = true
);
![torus_knot](images/lib-torus_knot-2.JPG)