TorusKnotGeometry.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Geometry] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">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.</div>
  14. <iframe src='scenes/geometry-browser.html#TorusKnotGeometry'></iframe>
  15. <h2>Example</h2>
  16. <code>var geometry = new THREE.TorusKnotGeometry( 10, 3, 100, 16 );
  17. var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  18. var torusKnot = new THREE.Mesh( geometry, material );
  19. scene.add( torusKnot );
  20. </code>
  21. <h2>Constructor</h2>
  22. <h3>[name]([page:Float radius], [page:Float tube], [page:Integer radialSegments], [page:Integer tubularSegments], [page:Integer p], [page:Integer q], [page:Float heightScale], [page:Float arc])</h3>
  23. <div>
  24. <ul>
  25. <li>radius — Default is 100.</li>
  26. <li>tube — Diameter of the tube. Default is 40.</li>
  27. <li>radialSegments — Default is 64.</li>
  28. <li>tubularSegments — Default is 8.</li>
  29. <li>p — This value determines, how many times the geometry winds around its axis of rotational symmetry. Default is 2.</li>
  30. <li>q — This value determines, how many times the geometry winds around a circle in the interior of the torus. Default is 3.</li>
  31. <li>heightScale — Default is 1.</li>
  32. <li>arc — Central angle. Default is Math.PI * 2.</li>
  33. </ul>
  34. </div>
  35. <h2>Properties</h2>
  36. <div>
  37. Each of the contructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
  38. </div>
  39. <h2>Source</h2>
  40. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  41. </body>
  42. </html>