mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-02-22 00:23:25 +01:00
39 lines
724 B
Markdown
39 lines
724 B
Markdown
# torus_knot
|
|
|
|
Generate a path of [The (p,q)-torus knot](https://en.wikipedia.org/wiki/Torus_knot).
|
|
|
|
**Since:** 1.2.
|
|
|
|

|
|
|
|
## 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
|
|
|
|
use <shape_pentagram.scad>;
|
|
use <path_extrude.scad>;
|
|
use <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,
|
|
method = "EULER_ANGLE"
|
|
);
|
|
|
|

|
|
|