Capítulo 213 de 859

Chapter 213: VTKLoader

Core Idea

A loader for the VTK format.

This loader only supports the POLYDATA dataset format so far. Other formats (structured points, structured grid, rectilinear grid, unstructured grid, appended) are not supported.

Code Examples

const loader = new VTKLoader();
const geometry = await loader.loadAsync( 'models/vtk/liver.vtk' );
geometry.computeVertexNormals();
const mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial() );
scene.add( mesh );
  • What it demonstrates: Typical usage of VTKLoader.

Reference Tables

Constructor

Signature
new VTKLoader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )Starts loading from the given URL and passes the loaded VTK asset to the onLoad() callback.
.parse( data : ArrayBuffer ) : BufferGeometryParses the given VTK data and returns the resulting geometry.

Key Takeaways

  1. VTKLoader extends: Loader
  2. Key methods: load, parse.

Connects To