ConeGeometry.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ConeGeometry - 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> → <a href="CylinderGeometry.html">CylinderGeometry</a> → </p>
  13. <h1 translate="no">ConeGeometry</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A geometry class for representing a cone.</p></div>
  17. <iframe id="viewer" src="../scenes/geometry-browser.html#ConeGeometry"></iframe>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const geometry = new THREE.ConeGeometry( 5, 20, 32 );
  20. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  21. const cone = new THREE.Mesh(geometry, material );
  22. scene.add( cone );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="ConeGeometry" translate="no">new <a href="#ConeGeometry">ConeGeometry</a><span class="signature">( radius : <span class="param-type">number</span>, height : <span class="param-type">number</span>, radialSegments : <span class="param-type">number</span>, heightSegments : <span class="param-type">number</span>, openEnded : <span class="param-type">boolean</span>, thetaStart : <span class="param-type">number</span>, thetaLength : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new cone geometry.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>radius</code></td>
  37. <td class="description last"><p>Radius of the cone base.<br/>Default is <code>1</code>.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>height</code></td>
  41. <td class="description last"><p>Height of the cone.<br/>Default is <code>1</code>.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>radialSegments</code></td>
  45. <td class="description last"><p>Number of segmented faces around the circumference of the cone.<br/>Default is <code>32</code>.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>heightSegments</code></td>
  49. <td class="description last"><p>Number of rows of faces along the height of the cone.<br/>Default is <code>1</code>.</p></td>
  50. </tr>
  51. <tr>
  52. <td class="name"><code>openEnded</code></td>
  53. <td class="description last"><p>Whether the base of the cone is open or capped.<br/>Default is <code>false</code>.</p></td>
  54. </tr>
  55. <tr>
  56. <td class="name"><code>thetaStart</code></td>
  57. <td class="description last"><p>Start angle for first segment, in radians.<br/>Default is <code>0</code>.</p></td>
  58. </tr>
  59. <tr>
  60. <td class="name"><code>thetaLength</code></td>
  61. <td class="description last"><p>The central angle, often called theta, of the circular sector, in radians.
  62. The default value results in a complete cone.<br/>Default is <code>Math.PI*2</code>.</p></td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Properties</h2>
  69. <div class="member">
  70. <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
  71. <div class="description">
  72. <p>Holds the constructor parameters that have been
  73. used to generate the geometry. Any modification
  74. after instantiation does not change the geometry.</p>
  75. </div>
  76. <dl class="details">
  77. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="CylinderGeometry.html#parameters">CylinderGeometry#parameters</a></dt>
  78. </dl>
  79. </div>
  80. <h2 class="subsection-title">Static Methods</h2>
  81. <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="ConeGeometry.html">ConeGeometry</a></span> </h3>
  82. <div class="method">
  83. <div class="description">
  84. <p>Factory method for creating an instance of this class from the given
  85. JSON object.</p>
  86. </div>
  87. <table class="params">
  88. <tbody>
  89. <tr>
  90. <td class="name"><code>data</code></td>
  91. <td class="description last"><p>A JSON object representing the serialized geometry.</p></td>
  92. </tr>
  93. </tbody>
  94. </table>
  95. <dl class="details">
  96. <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
  97. </dl>
  98. </div>
  99. <h2 class="subsection-title">Source</h2>
  100. <p>
  101. <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/ConeGeometry.js" target="_blank" rel="noopener" translate="no">src/geometries/ConeGeometry.js</a>
  102. </p>
  103. </article>
  104. </section>
  105. <script src="../scripts/linenumber.js"></script>
  106. <script src="../scripts/page.js"></script>
  107. </body>
  108. </html>
粤ICP备19079148号