Capítulo 625 de 859

Chapter 625: Wireframe

Core Idea

A class for creating wireframes based on wide lines.

This module can only be used with WebGLRenderer. When using WebGPURenderer, import the class from lines/webgpu/Wireframe.js.

Key Concepts

  • isWireframe : boolean (readonly): This flag can be used for type testing.

Code Examples

const geometry = new THREE.IcosahedronGeometry();
const wireframeGeometry = new WireframeGeometry2( geo );
const wireframe = new Wireframe( wireframeGeometry, material );
scene.add( wireframe );
  • What it demonstrates: Typical usage of Wireframe.

Reference Tables

Constructor

Signature
new Wireframe( geometry : LineSegmentsGeometry, material : LineMaterial )

Properties

PropertyDescription
.isWireframe : boolean (readonly)This flag can be used for type testing.

Methods

MethodDescription
.computeLineDistances() : WireframeComputes an array of distance values which are necessary for rendering dashed lines. For each vertex in the geometry, the method calculates the cumulative length from the current point to the very be…

Key Takeaways

  1. Wireframe extends: EventDispatcher → Object3D → Mesh
  2. Most relevant properties: isWireframe.
  3. Key methods: computeLineDistances.

Connects To