2019-05-20 11:10:39 +08:00
|
|
|
# torus_knot
|
|
|
|
|
|
|
|
Generate a path of [The (p,q)-torus knot](https://en.wikipedia.org/wiki/Torus_knot).
|
|
|
|
|
2019-05-20 15:04:05 +08:00
|
|
|
**Since:** 1.2.
|
2019-05-20 14:21:59 +08:00
|
|
|
|
2021-02-24 21:09:54 +08:00
|
|
|

|
2019-05-20 11:10:39 +08:00
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `p` : The p parameter of The (p,q)-torus knot.
|
|
|
|
- `q` : The q parameter of The (p,q)-torus knot.
|
2019-06-07 10:42:04 +08:00
|
|
|
- `phi_step` : The amount when increasing phi.
|
2019-05-20 11:10:39 +08:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
2020-01-28 17:51:20 +08:00
|
|
|
use <shape_pentagram.scad>;
|
|
|
|
use <path_extrude.scad>;
|
|
|
|
use <torus_knot.scad>;
|
2019-05-20 11:10:39 +08:00
|
|
|
|
|
|
|
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]]),
|
2019-05-20 11:47:27 +08:00
|
|
|
closed = true,
|
2019-06-07 10:42:56 +08:00
|
|
|
method = "EULER_ANGLE"
|
2019-05-20 11:10:39 +08:00
|
|
|
);
|
|
|
|
|
2021-02-24 21:09:54 +08:00
|
|
|

|
2019-05-20 11:10:39 +08:00
|
|
|
|