LatheGeometry.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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">
  13. Creates meshes with axial symmetry like vases. The lathe rotates around
  14. the Y axis.
  15. </p>
  16. <iframe
  17. id="scene"
  18. src="scenes/geometry-browser.html#LatheGeometry"
  19. ></iframe>
  20. <script>
  21. // iOS iframe auto-resize workaround
  22. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  23. const scene = document.getElementById( 'scene' );
  24. scene.style.width = getComputedStyle( scene ).width;
  25. scene.style.height = getComputedStyle( scene ).height;
  26. scene.setAttribute( 'scrolling', 'no' );
  27. }
  28. </script>
  29. <h2>Code Example</h2>
  30. <code>
  31. const points = [];
  32. for ( let i = 0; i < 10; i ++ ) {
  33. points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
  34. }
  35. const geometry = new THREE.LatheGeometry( points );
  36. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  37. const lathe = new THREE.Mesh( geometry, material );
  38. scene.add( lathe );
  39. </code>
  40. <h2>Constructor</h2>
  41. <h3>
  42. [name]([param:Array points], [param:Integer segments], [param:Float
  43. phiStart], [param:Float phiLength])
  44. </h3>
  45. <p>
  46. points — Array of Vector2s. The x-coordinate of each point must be greater
  47. than zero. Default is an array with (0,-0.5), (0.5,0) and (0,0.5) which
  48. creates a simple diamond shape.<br />
  49. segments — the number of circumference segments to generate. Default is
  50. 12.<br />
  51. phiStart — the starting angle in radians. Default is `0`.<br />
  52. phiLength — the radian (0 to 2PI) range of the lathed section 2PI is a
  53. closed lathe, less than 2PI is a portion. Default is 2PI.
  54. </p>
  55. <p>This creates a [name] based on the parameters.</p>
  56. <h2>Properties</h2>
  57. <p>See the base [page:BufferGeometry] class for common properties.</p>
  58. <h3>[property:Object parameters]</h3>
  59. <p>
  60. An object with a property for each of the constructor parameters. Any
  61. modification after instantiation does not change the geometry.
  62. </p>
  63. <h2>Methods</h2>
  64. <p>See the base [page:BufferGeometry] class for common methods.</p>
  65. <h2>Source</h2>
  66. <p>
  67. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  68. </p>
  69. </body>
  70. </html>