Capítulo 55 de 859

Chapter 55: TorusKnotGeometry

Core Idea

Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q. If p and q are not coprime, the result will be a torus link.

Key Concepts

  • parameters : Object: Holds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geo…

Code Examples

const geometry = new THREE.TorusKnotGeometry( 10, 3, 100, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const torusKnot = new THREE.Mesh( geometry, material );
scene.add( torusKnot );
  • What it demonstrates: Typical usage of TorusKnotGeometry.

Reference Tables

Constructor

Signature
new TorusKnotGeometry( radius : number, tube : number, tubularSegments : number, radialSegments : number, p : number, q : number )

Properties

PropertyDescription
.parameters : ObjectHolds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geometry.

Key Takeaways

  1. TorusKnotGeometry extends: EventDispatcher → BufferGeometry
  2. Most relevant properties: parameters.

Connects To