Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ExtrudeGeometry

Creates extruded geometry from a path shape.

See the ngx3js docs page for details. See the ngx geometey page for a live demo.

Examples

webgl / geometry / extrude / shapes | webgl / geometry / extrude / shapes2 | webgl / geometry / shapes

Code Example

const length = 12, width = 8;
const shape = new THREE.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 THREE.ExtrudeGeometry( shape, extrudeSettings );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );

Hierarchy

Index

Constructors

constructor

Properties

MaxIndex

MaxIndex: number

attributes

attributes: {}

This hashmap has as id the name of the attribute to be set and as value the buffer to set it to. Rather than accessing this property directly, use .setAttribute and .getAttribute to access attributes of this geometry.

default

{}

Type declaration

boundingBox

boundingBox: I3JS.Box3

Bounding box for the bufferGeometry, which can be calculated with .computeBoundingBox(). Default is null.

default

null

boundingSphere

boundingSphere: I3JS.Sphere

Bounding sphere for the bufferGeometry, which can be calculated with .computeBoundingSphere(). Default is null.

default

null

drawRange

drawRange: { count: number; start: number }

Determines the part of the geometry to render. This should not be set directly, instead use .setDrawRange. Default is { start: 0, count: Infinity } For non-indexed BufferGeometry, count is the number of vertices to render. For indexed BufferGeometry, count is the number of indices to render.

default

{ start: 0, count: Infinity }

Type declaration

  • count: number
  • start: number

groups

groups: { count: number; materialIndex?: number; start: number }[]

Split the geometry into groups, each of which will be rendered in a separate WebGL draw call. This allows an array of materials to be used with the bufferGeometry. Each group is an object of the form: { start: Integer, count: Integer, materialIndex: Integer } where start specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index. Count specifies how many vertices (or indices) are included, and materialIndex specifies the material array index to use. Use .addGroup to add groups, rather than modifying this array directly.

default

[]

id

id: number

Unique number for this bufferGeometry instance.

index

Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles". Each triangle is associated with the indices of three vertices. This attribute therefore stores the index of each vertex for each triangular face. If this attribute is not set, the renderer assumes that each three contiguous positions represent a single triangle. Default is null.

default

null

Readonly isBufferGeometry

isBufferGeometry: true

morphAttributes

morphAttributes: {}

Hashmap of BufferAttributes holding details of the geometry's morph targets.

default

{}

Type declaration

morphTargetsRelative

morphTargetsRelative: boolean

Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals. Default is false.

default

false

name

name: string

Optional name for this bufferGeometry instance. Default is an empty string.

default

''

Optional parameters

parameters?: any

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

type

type: string
default

'ExtrudeGeometry'

userData

userData: {}

An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.

default

{}

Type declaration

  • [key: string]: any

uuid

uuid: string

UUID of this object instance. This gets automatically assigned and shouldn't be edited.

Methods

addAttribute

  • addAttribute(name: any, array: any, itemSize: any): any

addEventListener

addGroup

  • addGroup(start: number, count: number, materialIndex?: number): void

addShape

  • addShape(shape: I3JS.Shape, options?: any): void

addShapeList

  • addShapeList(shapes: I3JS.Shape[], options?: any): void

applyMatrix4

applyQuaternion

center

clearGroups

  • clearGroups(): void

clone

computeBoundingBox

  • computeBoundingBox(): void

computeBoundingSphere

  • computeBoundingSphere(): void

computeTangents

  • computeTangents(): void

computeVertexNormals

  • computeVertexNormals(): void

copy

deleteAttribute

dispatchEvent

  • dispatchEvent(event: Event): void

dispose

  • dispose(): void

fromJSON

getAttribute

getIndex

hasAttribute

hasEventListener

lookAt

merge

normalizeNormals

  • normalizeNormals(): void

removeEventListener

rotateX

rotateY

rotateZ

scale

setAttribute

setDrawRange

  • setDrawRange(start: number, count: number): void

setFromPoints

setIndex

toJSON

  • toJSON(): any

toNonIndexed

translate

Generated using TypeDoc