123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- [page:Geometry] →
- <h1>[name]</h1>
- <div class="desc">Creates extruded geometry from a path shape.</div>
- <iframe id="scene" src="scenes/geometry-browser.html#ExtrudeGeometry"></iframe>
- <script>
- // iOS iframe auto-resize workaround
- if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
- var scene = document.getElementById( 'scene' );
- scene.style.width = getComputedStyle( scene ).width;
- scene.style.height = getComputedStyle( scene ).height;
- scene.setAttribute( 'scrolling', 'no' );
- }
- </script>
- <h2>Example</h2>
- <code>
- var length = 12, width = 8;
- var shape = new THREE.Shape();
- shape.moveTo( 0,0 );
- shape.lineTo( 0, width );
- shape.lineTo( length, width );
- shape.lineTo( length, 0 );
- shape.lineTo( 0, 0 );
- var extrudeSettings = {
- steps: 2,
- amount: 16,
- bevelEnabled: true,
- bevelThickness: 1,
- bevelSize: 1,
- bevelSegments: 1
- };
- var geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
- var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
- var mesh = new THREE.Mesh( geometry, material ) ;
- scene.add( mesh );
- </code>
- <h2>Constructor</h2>
- <h3>[name]([page:Array shapes], [page:Object options])</h3>
- <div>
- shapes — Shape or an array of shapes. <br />
- options — Object that can contain the following parameters.
- <ul>
- <li>curveSegments — int. number of points on the curves</li>
- <li>steps — int. number of points used for subdividing segements of extrude spline</li>
- <li>amount — int. Depth to extrude the shape</li>
- <li>bevelEnabled — bool. turn on bevel</li>
- <li>bevelThickness — float. how deep into the original shape bevel goes</li>
- <li>bevelSize — float. how far from shape outline is bevel</li>
- <li>bevelSegments — int. number of bevel layers</li>
- <li>extrudePath — THREE.CurvePath. 3d spline path to extrude shape along. (creates Frames if frames aren't defined)</li>
- <li>frames — THREE.TubeGeometry.FrenetFrames. containing arrays of tangents, normals, binormals</li>
- <li>material — int. material index for front and back faces</li>
- <li>extrudeMaterial — int. material index for extrusion and beveled faces</li>
- <li>UVGenerator — Object. object that provides UV generator functions</li>
- </ul>
- </div>
- <div>
- This object extrudes an 2D shape to an 3D geometry.
- </div>
- <h2>Properties</h2>
- <h2>Methods</h2>
- <h3>[method:null addShapeList]([page:Array shapes], [page:Object options])</h3>
- <div>
- shapes — An Array of shapes to add. <br />
- options — Object that can contain the following parameters.
- <ul>
- <li>curveSegments — int. number of points on the curves</li>
- <li>steps — int. number of points used for subdividing segements of extrude spline</li>
- <li>amount — int. Depth to extrude the shape</li>
- <li>bevelEnabled — bool. turn on bevel</li>
- <li>bevelThickness — float. how deep into the original shape bevel goes</li>
- <li>bevelSize — float. how far from shape outline is bevel</li>
- <li>bevelSegments — int. number of bevel layers</li>
- <li>extrudePath — THREE.Curve. curve to extrude shape along</li>
- <li>frames — Object. containing arrays of tangents, normals, binormals</li>
- <li>material — int. material index for front and back faces</li>
- <li>extrudeMaterial — int. material index for extrusion and beveled faces</li>
- <li>UVGenerator — Object. object that provides UV generator functions</li>
- </ul>
- </div>
- <div>Adds the shapes to the list to extrude.</div>
- <h3>[method:null addShape]([page:Shape shape], [page:Object options])</h3>
- <div>
- shape — A shape to add. <br />
- options — Object that can contain the following parameters.
- <ul>
- <li>curveSegments — int. number of points on the curves</li>
- <li>steps — int. number of points used for subdividing segements of extrude spline</li>
- <li>amount — int. Depth to extrude the shape</li>
- <li>bevelEnabled — bool. turn on bevel</li>
- <li>bevelThickness — float. how deep into the original shape bevel goes</li>
- <li>bevelSize — float. how far from shape outline is bevel</li>
- <li>bevelSegments — int. number of bevel layers</li>
- <li>extrudePath — THREE.Curve. curve to extrude shape along</li>
- <li>frames — Object. containing arrays of tangents, normals, binormals</li>
- <li>material — int. material index for front and back faces</li>
- <li>extrudeMaterial — int. material index for extrusion and beveled faces</li>
- <li>UVGenerator — Object. object that provides UV generator functions</li>
- </ul>
- </div>
- <div>Add the shape to the list to extrude.</div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
- </html>
|