[page:Geometry] →
[name]
Creates a one-sided polygonal geometry from one or more path shapes. Similar to [page:ExtrudeGeometry].
Example
var length = 16, width = 12;
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 geometry = new THREE.ShapeGeometry( shape );
var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
var mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );
Constructor
[name]([page:Array shapes], [page:Object options])
shapes — [page:Array] of shapes, or a single [page:Shape shape]
options — Optional options [page:Object object]
- curveSegments - [page:Integer] - Not used at the moment - defaults to 12
- material - [page:Integer] - index of the material in a material list
- UVGenerator - A UV generator, defaults to [page:ExtrudeGeometry]'s WorldUVGenerator
Methods
.addShapeList([page:Array shapes], [page:Object options]) [page:this]
shapes — [page:Array] of [page:Shape shapes]
options — See options in constructor
Adds a list of shapes to the geometry.
[method:null addShape]([page:Shape shape], [page:Object options])
shape — [page:Shape]
options — See options in constructor
Adds a single shape to the geometry
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]