BufferGeometry

ShapeBufferGeometry

Creates an one-sided polygonal geometry from one or more path shapes.

Example

var x = 0, y = 0; var heartShape = new v3d.Shape(); heartShape.moveTo(x + 5, y + 5); heartShape.bezierCurveTo(x + 5, y + 5, x + 4, y, x, y); heartShape.bezierCurveTo(x - 6, y, x - 6, y + 7,x - 6, y + 7); heartShape.bezierCurveTo(x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19); heartShape.bezierCurveTo(x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7); heartShape.bezierCurveTo(x + 16, y + 7, x + 16, y, x + 10, y); heartShape.bezierCurveTo(x + 7, y, x + 5, y + 5, x + 5, y + 5); var geometry = new v3d.ShapeBufferGeometry(heartShape); var material = new v3d.MeshBasicMaterial({ color: 0x00ff00 }); var mesh = new v3d.Mesh(geometry, material) ; scene.add(mesh);

Constructor

ShapeBufferGeometry(shapes : Array, curveSegments : Integer)

shapes — Array of shapes or a single shape.
curveSegments - Integer - Number of segments per shape. Default is 12.

Properties

See the base BufferGeometry class for common properties.

.parameters : Object

An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.

Methods

See the base BufferGeometry class for common methods.

Source

src/geometries/ShapeGeometry.js