CircleGeometry.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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">
  42. <strong>radius</strong>
  43. </td>
  44. <td class="description last">
  45. <p>Radius of the circle.</p>
  46. <p>Default is <code>1</code>.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong>segments</strong>
  52. </td>
  53. <td class="description last">
  54. <p>Number of segments (triangles), minimum = <code>3</code>.</p>
  55. <p>Default is <code>32</code>.</p>
  56. </td>
  57. </tr>
  58. <tr>
  59. <td class="name">
  60. <strong>thetaStart</strong>
  61. </td>
  62. <td class="description last">
  63. <p>Start angle for first segment in radians.</p>
  64. <p>Default is <code>0</code>.</p>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td class="name">
  69. <strong>thetaLength</strong>
  70. </td>
  71. <td class="description last">
  72. <p>The central angle, often called theta,
  73. of the circular sector in radians. The default value results in a complete circle.</p>
  74. <p>Default is <code>Math.PI*2</code>.</p>
  75. </td>
  76. </tr>
  77. </tbody>
  78. </table>
  79. </div>
  80. </div>
  81. <h2 class="subsection-title">Properties</h2>
  82. <div class="member">
  83. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  84. <div class="description">
  85. <p>Holds the constructor parameters that have been
  86. used to generate the geometry. Any modification
  87. after instantiation does not change the geometry.</p>
  88. </div>
  89. </div>
  90. <h2 class="subsection-title">Static Methods</h2>
  91. <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>
  92. <div class="method">
  93. <div class="description">
  94. <p>Factory method for creating an instance of this class from the given
  95. JSON object.</p>
  96. </div>
  97. <table class="params">
  98. <tbody>
  99. <tr>
  100. <td class="name">
  101. <strong>data</strong>
  102. </td>
  103. <td class="description last">
  104. <p>A JSON object representing the serialized geometry.</p>
  105. </td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. <dl class="details">
  110. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  111. </dl>
  112. </div>
  113. <h2 class="subsection-title">Source</h2>
  114. <p>
  115. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/CircleGeometry.js" translate="no" target="_blank" rel="noopener">src/geometries/CircleGeometry.js</a>
  116. </p>
  117. </article>
  118. </section>
  119. <script src="../scripts/linenumber.js"></script>
  120. <script src="../scripts/page.js"></script>
  121. </body>
  122. </html>
粤ICP备19079148号