LatheGeometry.html 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>LatheGeometry - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="BufferGeometry.html">BufferGeometry</a> → </p>
  13. <h1 translate="no">LatheGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Creates meshes with axial symmetry like vases. The lathe rotates around the Y axis.</p></div>
  17. <iframe id="viewer" src="../scenes/geometry-browser.html#LatheGeometry"></iframe>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const points = [];
  20. for ( let i = 0; i &lt; 10; i ++ ) {
  21. points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
  22. }
  23. const geometry = new THREE.LatheGeometry( points );
  24. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  25. const lathe = new THREE.Mesh( geometry, material );
  26. scene.add( lathe );
  27. </code></pre></div>
  28. </header>
  29. <article>
  30. <div class="container-overview">
  31. <h2>Constructor</h2>
  32. <h3 class="name name-method" id="LatheGeometry" translate="no">new <a href="#LatheGeometry">LatheGeometry</a><span class="signature">( points : <span class="param-type">Array.&lt;(Vector2|Vector3)></span>, segments : <span class="param-type">number</span>, phiStart : <span class="param-type">number</span>, phiLength : <span class="param-type">number</span> )</span> </h3>
  33. <div class="method">
  34. <div class="description">
  35. <p>Constructs a new lathe geometry.</p>
  36. </div>
  37. <table class="params">
  38. <tbody>
  39. <tr>
  40. <td class="name"><code>points</code></td>
  41. <td class="description last"><p>An array of points in 2D space. The x-coordinate of each point
  42. must be greater than zero.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>segments</code></td>
  46. <td class="description last"><p>The number of circumference segments to generate.<br/>Default is <code>12</code>.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>phiStart</code></td>
  50. <td class="description last"><p>The starting angle in radians.<br/>Default is <code>0</code>.</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>phiLength</code></td>
  54. <td class="description last"><p>The radian (0 to 2PI) range of the lathed section 2PI is a
  55. closed lathe, less than 2PI is a portion.<br/>Default is <code>Math.PI*2</code>.</p></td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. <h2 class="subsection-title">Properties</h2>
  62. <div class="member">
  63. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  64. <div class="description">
  65. <p>Holds the constructor parameters that have been
  66. used to generate the geometry. Any modification
  67. after instantiation does not change the geometry.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Static Methods</h2>
  71. <h3 class="name name-method" id=".fromJSON" translate="no">.<a href="#.fromJSON">fromJSON</a><span class="signature">( data : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="LatheGeometry.html">LatheGeometry</a></span> </h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>Factory method for creating an instance of this class from the given
  75. JSON object.</p>
  76. </div>
  77. <table class="params">
  78. <tbody>
  79. <tr>
  80. <td class="name"><code>data</code></td>
  81. <td class="description last"><p>A JSON object representing the serialized geometry.</p></td>
  82. </tr>
  83. </tbody>
  84. </table>
  85. <dl class="details">
  86. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  87. </dl>
  88. </div>
  89. <h2 class="subsection-title">Source</h2>
  90. <p>
  91. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/LatheGeometry.js" target="_blank" rel="noopener" translate="no">src/geometries/LatheGeometry.js</a>
  92. </p>
  93. </article>
  94. </section>
  95. <script src="../scripts/linenumber.js"></script>
  96. <script src="../scripts/page.js"></script>
  97. </body>
  98. </html>
粤ICP备19079148号