A torus knot

Consider the geometry produced by this function call:

new THREE.TorusKnotGeometry(radius, tube, tubularSegments, 
                            radialSegments, p, q)

The controls in this program let you vary the arguments to generate different torus knots:

Torus knot

The first two and last two parameters set the geometry:

  • radius — Radius of the torus (i.e., along the length)
  • tube — Radius of the tube (i.e., in a cross-section)
  • p — Number of times it winds around the axis of rotational symmetry
  • q — Number of times it winds around a circle in the torus’s interior

The middle two parameters determine granularity of the triangular mesh:

  • tubularSegments — Segments along the length
  • radialSegments — Segments around a cross-section

It can be explained using a formula, but instead we can get intuition by looking at the results of varying the arguments.