[page:Geometry] →

[name]

Creates a one-sided polygonal geometry from one or more path shapes. Similar to [page:ExtrudeGeometry]

Example

var rectLength = 120, rectWidth = 40; var rectShape = new THREE.Shape(); rectShape.moveTo( 0,0 ); rectShape.lineTo( 0, rectWidth ); rectShape.lineTo( rectLength, rectWidth ); rectShape.lineTo( rectLength, 0 ); rectShape.lineTo( 0, 0 ); var rectGeom = new THREE.ShapeGeometry( rectShape ); var rectMesh = new THREE.Mesh( rectGeom, new THREE.MeshBasicMaterial( { color: 0xff0000 } ) ) ; scene.add( rectMesh );

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]

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]