LatheGeometry.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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;(<a href="Vector2.html">Vector2</a>|<a href="Vector3.html">Vector3</a>)></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">
  41. <strong>points</strong>
  42. </td>
  43. <td class="description last">
  44. <p>An array of points in 2D space. The x-coordinate of each point
  45. must be greater than zero.</p>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="name">
  50. <strong>segments</strong>
  51. </td>
  52. <td class="description last">
  53. <p>The number of circumference segments to generate.</p>
  54. <p>Default is <code>12</code>.</p>
  55. </td>
  56. </tr>
  57. <tr>
  58. <td class="name">
  59. <strong>phiStart</strong>
  60. </td>
  61. <td class="description last">
  62. <p>The starting angle in radians.</p>
  63. <p>Default is <code>0</code>.</p>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td class="name">
  68. <strong>phiLength</strong>
  69. </td>
  70. <td class="description last">
  71. <p>The radian (0 to 2PI) range of the lathed section 2PI is a
  72. closed lathe, less than 2PI is a portion.</p>
  73. <p>Default is <code>Math.PI*2</code>.</p>
  74. </td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Properties</h2>
  81. <div class="member">
  82. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  83. <div class="description">
  84. <p>Holds the constructor parameters that have been
  85. used to generate the geometry. Any modification
  86. after instantiation does not change the geometry.</p>
  87. </div>
  88. </div>
  89. <h2 class="subsection-title">Static Methods</h2>
  90. <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>
  91. <div class="method">
  92. <div class="description">
  93. <p>Factory method for creating an instance of this class from the given
  94. JSON object.</p>
  95. </div>
  96. <table class="params">
  97. <tbody>
  98. <tr>
  99. <td class="name">
  100. <strong>data</strong>
  101. </td>
  102. <td class="description last">
  103. <p>A JSON object representing the serialized geometry.</p>
  104. </td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <dl class="details">
  109. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  110. </dl>
  111. </div>
  112. <h2 class="subsection-title">Source</h2>
  113. <p>
  114. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/LatheGeometry.js" translate="no" target="_blank" rel="noopener">src/geometries/LatheGeometry.js</a>
  115. </p>
  116. </article>
  117. </section>
  118. <script src="../scripts/linenumber.js"></script>
  119. <script src="../scripts/page.js"></script>
  120. </body>
  121. </html>
粤ICP备19079148号