| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>ExtrudeGeometry - 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">ExtrudeGeometry</h1>
- <section>
- <header>
- <div class="class-description"><p>Creates extruded geometry from a path shape.</p></div>
- <iframe id="viewer" src="../scenes/geometry-browser.html#ExtrudeGeometry"></iframe>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const length = 12, width = 8;
- const shape = new THREE.Shape();
- shape.moveTo( 0,0 );
- shape.lineTo( 0, width );
- shape.lineTo( length, width );
- shape.lineTo( length, 0 );
- shape.lineTo( 0, 0 );
- const geometry = new THREE.ExtrudeGeometry( shape );
- const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
- const mesh = new THREE.Mesh( geometry, material ) ;
- scene.add( mesh );
- </code></pre></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="ExtrudeGeometry" translate="no">new <a href="#ExtrudeGeometry">ExtrudeGeometry</a><span class="signature">( shapes : <span class="param-type">Shape | Array.<Shape></span>, options : <span class="param-type">ExtrudeGeometry~Options</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new extrude geometry.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>shapes</code></td>
- <td class="description last"><p>A shape or an array of shapes.</p></td>
- </tr>
- <tr>
- <td class="name"><code>options</code></td>
- <td class="description last"><p>The extrude settings.</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>, shapes : <span class="param-type">Array.<Shape></span> )</span><span class="type-signature"> : <a href="ExtrudeGeometry.html">ExtrudeGeometry</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"><code>data</code></td>
- <td class="description last"><p>A JSON object representing the serialized geometry.</p></td>
- </tr>
- <tr>
- <td class="name"><code>shapes</code></td>
- <td class="description last"><p>An array of shapes.</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">Type Definitions</h2>
- <div class="member">
- <h3 class="name" id="~Options" translate="no">.<a href="#~Options">Options</a> </h3>
- <div class="description">
- <p>Represents the <code>options</code> type of the geometry's constructor.</p>
- </div>
- <h5 class="subsection-title">Properties:</h5>
- <table class="props">
- <thead>
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Attributes</th>
- <th>Default</th>
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="name"><code>curveSegments</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 12
- </td>
- <td class="description last"><p>Number of points on the curves.</p></td>
- </tr>
- <tr>
- <td class="name"><code>steps</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 1
- </td>
- <td class="description last"><p>Number of points used for subdividing segments along the depth of the extruded spline.</p></td>
- </tr>
- <tr>
- <td class="name"><code>depth</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 1
- </td>
- <td class="description last"><p>Depth to extrude the shape.</p></td>
- </tr>
- <tr>
- <td class="name"><code>bevelEnabled</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- true
- </td>
- <td class="description last"><p>Whether to beveling to the shape or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>bevelThickness</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 0.2
- </td>
- <td class="description last"><p>How deep into the original shape the bevel goes.</p></td>
- </tr>
- <tr>
- <td class="name"><code>bevelSize</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- bevelThickness-0.1
- </td>
- <td class="description last"><p>Distance from the shape outline that the bevel extends.</p></td>
- </tr>
- <tr>
- <td class="name"><code>bevelOffset</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 0
- </td>
- <td class="description last"><p>Distance from the shape outline that the bevel starts.</p></td>
- </tr>
- <tr>
- <td class="name"><code>bevelSegments</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 3
- </td>
- <td class="description last"><p>Number of bevel layers.</p></td>
- </tr>
- <tr>
- <td class="name"><code>extrudePath</code></td>
- <td class="type">
- <span class="param-type"><a href="Curve.html">Curve</a></span>
- </td>
- <td class="attributes">
- <optional><br>
- <nullable><br>
- </td>
- <td class="default">
- null
- </td>
- <td class="description last"><p>A 3D spline path along which the shape should be extruded. Bevels not supported for path extrusion.</p></td>
- </tr>
- <tr>
- <td class="name"><code>UVGenerator</code></td>
- <td class="type">
- <span class="param-type">Object</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- </td>
- <td class="description last"><p>An object that provides UV generator functions for custom UV generation.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/geometries/ExtrudeGeometry.js" target="_blank" rel="noopener" translate="no">src/geometries/ExtrudeGeometry.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|