TorusGeometry.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">A class for generating torus geometries.</p>
  13. <iframe
  14. id="scene"
  15. src="scenes/geometry-browser.html#TorusGeometry"
  16. ></iframe>
  17. <script>
  18. // iOS iframe auto-resize workaround
  19. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  20. const scene = document.getElementById( 'scene' );
  21. scene.style.width = getComputedStyle( scene ).width;
  22. scene.style.height = getComputedStyle( scene ).height;
  23. scene.setAttribute( 'scrolling', 'no' );
  24. }
  25. </script>
  26. <h2>Code Example</h2>
  27. <code>
  28. const geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );
  29. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  30. const torus = new THREE.Mesh( geometry, material ); scene.add( torus );
  31. </code>
  32. <h2>Constructor</h2>
  33. <h3>
  34. [name]([param:Float radius], [param:Float tube], [param:Integer radialSegments], [param:Integer tubularSegments], [param:Float arc])
  35. </h3>
  36. <p>
  37. radius - Radius of the torus, from the center of the torus to the center
  38. of the tube. Default is `1`. <br />
  39. tube — Radius of the tube. Default is `0.4`. <br />
  40. radialSegments — Default is `12` <br />
  41. tubularSegments — Default is `48`. <br />
  42. arc — Central angle. Default is Math.PI * 2.
  43. </p>
  44. <h2>Properties</h2>
  45. <p>See the base [page:BufferGeometry] class for common properties.</p>
  46. <h3>[property:Object parameters]</h3>
  47. <p>
  48. An object with a property for each of the constructor parameters. Any
  49. modification after instantiation does not change the geometry.
  50. </p>
  51. <h2>Methods</h2>
  52. <p>See the base [page:BufferGeometry] class for common methods.</p>
  53. <h2>Source</h2>
  54. <p>
  55. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  56. </p>
  57. </body>
  58. </html>