Inheritance: Loader →
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.
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 );
VTKLoader is an addon, and must be imported explicitly, see Installation#Addons.
import { VTKLoader } from 'three/addons/loaders/VTKLoader.js';
Constructs a new VTK loader.
manager
The loading manager.
Starts loading from the given URL and passes the loaded VRML asset to the onLoad() callback.
url
The path/URL of the file to be loaded. This can also be a data URI.
onLoad
Executed when the loading process has been finished.
onProgress
Executed while the loading is in progress.
onError
Executed when errors occur.
Overrides: Loader#load
Parses the given VTK data and returns the resulting geometry.
data
The raw VTK data as an array buffer
Overrides: Loader#parse
Returns: The parsed geometry.