1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/docs/lib-torus_knot.md
Justin Lin d2287ff119 format
2019-06-07 10:42:04 +08:00

777 B

torus_knot

Generate a path of The (p,q)-torus knot.

Since: 1.2.

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,
	twist = 188
);

torus_knot