ExtrudeGeometry - Verge3D User Manual - Soft8Soft
Description: Learn how to use ExtrudeGeometry in your interactive 3D apps made with Verge3D

BufferGeometry →

# ExtrudeGeometry

Creates extruded geometry from a path shape.

## Code Example

`const length = 3, width = 2; const shape = new v3d.Shape(); shape.moveTo(-length/2, -width/2); shape.lineTo(-length/2, width/2); shape.lineTo(length/2, width/2); shape.lineTo(length/2, -width/2); shape.lineTo(-length/2, -width/2); const extrudeSettings = { steps: 2, depth: 2, bevelEnabled: true, bevelThickness: 0.5, bevelSize: 0.5, bevelOffset: 0, bevelSegments: 1 }; const geometry = new v3d.ExtrudeGeometry(shape, extrudeSettings); const material = new v3d.MeshStandardMaterial({ color: 0x8458b3 }); const mesh = new v3d.Mesh(geometry, material) ; app.scene.add(mesh);`

## Constructor

### ExtrudeGeometry(shapes : Array, options : Object)

- shapes — shape or an array of shapes.
- options — object that can contain the following parameters:

- curveSegments — number of points on the curves. Default is `12`.
- steps — number of points used for subdividing segments along the depth of the extruded spline. Default is `1`.
- depth — depth to extrude the shape. Default is `1`.
- bevelEnabled — apply beveling to the shape. Default is `true`.
- bevelThickness — how deep into the original shape the bevel goes. Default is `0.2`.
- bevelSize — distance from the shape outline that the bevel extends. Default is `bevelThickness - 0.1`.
- bevelOffset — distance from the shape outline that the bevel starts. Default is `0`.
- bevelSegments — number of bevel layers. Default is `3`.
- extrudePath — a 3D spline path along which the shape should be extruded. Bevels not supported for path extrusion.
- UVGenerator — 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

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

For more info on how to obtain the source code of this module see this page.