| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>CylinderGeometry - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="BufferGeometry.html">BufferGeometry</a> → </p>
- <h1 translate="no">CylinderGeometry</h1>
- <section>
- <header>
- <div class="class-description"><p>A geometry class for representing a cylinder.</p></div>
- <iframe id="viewer" src="../scenes/geometry-browser.html#CylinderGeometry"></iframe>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );
- const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
- const cylinder = new THREE.Mesh( geometry, material );
- scene.add( cylinder );
- </code></pre></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="CylinderGeometry" translate="no">new <a href="#CylinderGeometry">CylinderGeometry</a><span class="signature">( radiusTop : <span class="param-type">number</span>, radiusBottom : <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>
- <div class="method">
- <div class="description">
- <p>Constructs a new cylinder geometry.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>radiusTop</strong>
- </td>
- <td class="description last">
- <p>Radius of the cylinder at the top.</p>
- <p>Default is <code>1</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>radiusBottom</strong>
- </td>
- <td class="description last">
- <p>Radius of the cylinder at the bottom.</p>
- <p>Default is <code>1</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>height</strong>
- </td>
- <td class="description last">
- <p>Height of the cylinder.</p>
- <p>Default is <code>1</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>radialSegments</strong>
- </td>
- <td class="description last">
- <p>Number of segmented faces around the circumference of the cylinder.</p>
- <p>Default is <code>32</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>heightSegments</strong>
- </td>
- <td class="description last">
- <p>Number of rows of faces along the height of the cylinder.</p>
- <p>Default is <code>1</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>openEnded</strong>
- </td>
- <td class="description last">
- <p>Whether the base of the cylinder is open or capped.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>thetaStart</strong>
- </td>
- <td class="description last">
- <p>Start angle for first segment, in radians.</p>
- <p>Default is <code>0</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>thetaLength</strong>
- </td>
- <td class="description last">
- <p>The central angle, often called theta, of the circular sector, in radians.
- The default value results in a complete cylinder.</p>
- <p>Default is <code>Math.PI*2</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="parameters" translate="no">.<a href="#parameters">parameters</a><span class="type-signature"> : Object</span> </h3>
- <div class="description">
- <p>Holds the constructor parameters that have been
- used to generate the geometry. Any modification
- after instantiation does not change the geometry.</p>
- </div>
- </div>
- <h2 class="subsection-title">Static Methods</h2>
- <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="CylinderGeometry.html">CylinderGeometry</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Factory method for creating an instance of this class from the given
- JSON object.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>data</strong>
- </td>
- <td class="description last">
- <p>A JSON object representing the serialized geometry.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A new instance.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/CylinderGeometry.js" translate="no" target="_blank" rel="noopener">src/geometries/CylinderGeometry.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|