mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 10:14:41 +02:00
add doc
This commit is contained in:
BIN
docs/images/lib-torus_knot-1.JPG
Normal file
BIN
docs/images/lib-torus_knot-1.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
docs/images/lib-torus_knot-2.JPG
Normal file
BIN
docs/images/lib-torus_knot-2.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
37
docs/lib-torus_knot.md
Normal file
37
docs/lib-torus_knot.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# torus_knot
|
||||||
|
|
||||||
|
Generate a path of [The (p,q)-torus knot](https://en.wikipedia.org/wiki/Torus_knot).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 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
|
||||||
|
);
|
||||||
|
|
||||||
|

|
||||||
|
|
Reference in New Issue
Block a user