Capítulo 48 de 859

Chapter 48: ShapeGeometry

Core Idea

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

Key Concepts

  • parameters : Object: Holds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geo…

Code Examples

const arcShape = new THREE.Shape()
	.moveTo( 5, 1 )
	.absarc( 1, 1, 4, 0, Math.PI * 2, false );
const geometry = new THREE.ShapeGeometry( arcShape );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00, side: THREE.DoubleSide } );
const mesh = new THREE.Mesh( geometry, material ) ;
scene.add( mesh );
  • What it demonstrates: Typical usage of ShapeGeometry.

Reference Tables

Constructor

Signature
`new ShapeGeometry( shapes : Shape

Properties

PropertyDescription
.parameters : ObjectHolds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geometry.

Key Takeaways

  1. ShapeGeometry extends: EventDispatcher → BufferGeometry
  2. Most relevant properties: parameters.

Connects To