CircleGeometry.html 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CircleGeometry - 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">CircleGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A simple shape of Euclidean geometry. It is constructed from a
  17. number of triangular segments that are oriented around a central point and
  18. extend as far out as a given radius. It is built counter-clockwise from a
  19. start angle and a given central angle. It can also be used to create
  20. regular polygons, where the number of segments determines the number of
  21. sides.</p></div>
  22. <iframe id="viewer" src="../scenes/geometry-browser.html#CircleGeometry"></iframe>
  23. <h2>Code Example</h2>
  24. <div translate="no"><pre><code class="language-js">const geometry = new THREE.CircleGeometry( 5, 32 );
  25. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  26. const circle = new THREE.Mesh( geometry, material );
  27. scene.add( circle )
  28. </code></pre></div>
  29. </header>
  30. <article>
  31. <div class="container-overview">
  32. <h2>Constructor</h2>
  33. <h3 class="name name-method" id="CircleGeometry" translate="no">new <a href="#CircleGeometry">CircleGeometry</a><span class="signature">( radius : <span class="param-type">number</span>, segments : <span class="param-type">number</span>, thetaStart : <span class="param-type">number</span>, thetaLength : <span class="param-type">number</span> )</span> </h3>
  34. <div class="method">
  35. <div class="description">
  36. <p>Constructs a new circle geometry.</p>
  37. </div>
  38. <table class="params">
  39. <tbody>
  40. <tr>
  41. <td class="name"><code>radius</code></td>
  42. <td class="description last"><p>Radius of the circle.<br/>Default is <code>1</code>.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>segments</code></td>
  46. <td class="description last"><p>Number of segments (triangles), minimum = <code>3</code>.<br/>Default is <code>32</code>.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>thetaStart</code></td>
  50. <td class="description last"><p>Start angle for first segment in radians.<br/>Default is <code>0</code>.</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>thetaLength</code></td>
  54. <td class="description last"><p>The central angle, often called theta,
  55. of the circular sector in radians. The default value results in a complete circle.<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="CircleGeometry.html">CircleGeometry</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/CircleGeometry.js" target="_blank" rel="noopener" translate="no">src/geometries/CircleGeometry.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号