2
0

LatheGeometry.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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">Creates meshes with axial symmetry like vases. The lathe rotates around the Y axis.</p>
  13. <iframe id="scene" src="scenes/geometry-browser.html#LatheGeometry"></iframe>
  14. <script>
  15. // iOS iframe auto-resize workaround
  16. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  17. const scene = document.getElementById( 'scene' );
  18. scene.style.width = getComputedStyle( scene ).width;
  19. scene.style.height = getComputedStyle( scene ).height;
  20. scene.setAttribute( 'scrolling', 'no' );
  21. }
  22. </script>
  23. <h2>Code Example</h2>
  24. <code>
  25. const points = [];
  26. for ( let i = 0; i < 10; i ++ ) {
  27. points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
  28. }
  29. const geometry = new THREE.LatheGeometry( points );
  30. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  31. const lathe = new THREE.Mesh( geometry, material );
  32. scene.add( lathe );
  33. </code>
  34. <h2>Constructor</h2>
  35. <h3>[name]([param:Array points], [param:Integer segments], [param:Float phiStart], [param:Float phiLength])</h3>
  36. <p>
  37. points — Array of Vector2s. The x-coordinate of each point must be greater than zero.<br />
  38. segments — the number of circumference segments to generate. Default is 12.<br />
  39. phiStart — the starting angle in radians. Default is 0.<br />
  40. phiLength — the radian (0 to 2PI) range of the lathed section 2PI is a closed lathe, less than 2PI is a portion. Default is 2PI.
  41. </p>
  42. <p>
  43. This creates a [name] based on the parameters.
  44. </p>
  45. <h2>Properties</h2>
  46. <p>See the base [page:BufferGeometry] class for common properties.</p>
  47. <h3>[property:Object parameters]</h3>
  48. <p>
  49. An object with a property for each of the constructor parameters. Any 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>