Creates extruded geometry from a path shape.
const length = 12, width = 8;
const shape = new v3d.Shape();
shape.moveTo(0,0);
shape.lineTo(0, width);
shape.lineTo(length, width);
shape.lineTo(length, 0);
shape.lineTo(0, 0);
const extrudeSettings = {
steps: 2,
depth: 16,
bevelEnabled: true,
bevelThickness: 1,
bevelSize: 1,
bevelOffset: 0,
bevelSegments: 1
};
const geometry = new v3d.ExtrudeGeometry(shape, extrudeSettings);
const material = new v3d.MeshBasicMaterial({ color: 0x00ff00 });
const mesh = new v3d.Mesh(geometry, material) ;
app.scene.add(mesh);
shapes — shape or an array of shapes.
options — object that can contain the following parameters:
12
.1
.1
.true
.0.2
.bevelThickness - 0.1
.0
.3
.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.
See the base BufferGeometry class for common properties.
An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
See the base BufferGeometry class for common methods.
For more info on how to obtain the source code of this module see this page.