[page:Geometry] →
[name]
Creates extruded geometry from a path shape.
Example
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 );
Constructor
[name]([param:Array shapes], [param:Object options])
shapes — Shape or an array of shapes.
options — Object that can contain the following parameters.
- curveSegments — int. Number of points on the curves. Default is 12.
- steps — int. Number of points used for subdividing segments along the depth of the extruded spline. Default is 1.
- amount — int. Depth to extrude the shape. Default is 100.
- bevelEnabled — bool. Apply beveling to the shape. Default is true.
- bevelThickness — float. How deep into the original shape the bevel goes. Default is 6.
- bevelSize — float. Distance from the shape outline that the bevel extends. Default is bevelThickness - 2.
- bevelSegments — int. Number of bevel layers. Default is 3.
- extrudePath — THREE.CurvePath. A 3D spline path along which the shape should be extruded (creates Frames if frames aren't defined).
- frames — An object containing arrays of tangents, normals, binormals for each step along the extrudePath.
- UVGenerator — Object. object that provides UV generator functions
This object extrudes a 2D shape to a 3D geometry.
When creating a Mesh with this geometry, if you'd like to have a separate material used for its face
and its extruded sides, you can use an array of materials. The first material will be
applied to the face; the second material will be applied to the sides.
Properties
Methods
[method:null addShapeList]([param:Array shapes], [param:Object options])
shapes — An Array of shapes to add.
options — Object that can contain the following parameters.
- curveSegments — int. Number of points on the curves. Default is 12.
- steps — int. Number of points used for subdividing segments along the depth of the extruded spline. Default is 1.
- amount — int. Depth to extrude the shape. Default is 100.
- bevelEnabled — bool. Apply beveling to the shape. Default is true.
- bevelThickness — float. How deep into the original shape the bevel goes. Default is 6.
- bevelSize — float. Distance from the shape outline that the bevel extends. Default is bevelThickness - 2.
- bevelSegments — int. Number of bevel layers. Default is 3.
- extrudePath — THREE.CurvePath. A 3D spline path along which the shape should be extruded (creates Frames if frames aren't defined).
- frames — An object containing arrays of tangents, normals, binormals for each step along the extrudePath.
- UVGenerator — Object. object that provides UV generator functions
Adds the shapes to the list to extrude.
[method:null addShape]([param:Shape shape], [param:Object options])
shape — A shape to add.
options — Object that can contain the following parameters.
- curveSegments — int. Number of points on the curves. Default is 12.
- steps — int. Number of points used for subdividing segments along the depth of the extruded spline. Default is 1.
- amount — int. Depth to extrude the shape. Default is 100.
- bevelEnabled — bool. Apply beveling to the shape. Default is true.
- bevelThickness — float. How deep into the original shape the bevel goes. Default is 6.
- bevelSize — float. Distance from the shape outline that the bevel extends. Default is bevelThickness - 2.
- bevelSegments — int. Number of bevel layers. Default is 3.
- extrudePath — THREE.CurvePath. A 3D spline path along which the shape should be extruded (creates Frames if frames aren't defined).
- frames — An object containing arrays of tangents, normals, binormals for each step along the extrudePath.
- UVGenerator — Object. object that provides UV generator functions
Add the shape to the list to extrude.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]