Caution: The example is not actually loading a vtp file but a data structrure that was coming from a vtp file. For more details please read the vtkHttpDataSetReader API;
Source
import'@kitware/vtk.js/favicon';
// Load the rendering pieces we want to use (for both WebGL and WebGPU) import'@kitware/vtk.js/Rendering/Profiles/Geometry';
// ---------------------------------------------------------------------------- // Example code // ---------------------------------------------------------------------------- // Server is not sending the .gz and with the compress header // Need to fetch the true file name and uncompress it locally // ----------------------------------------------------------------------------
const actor = vtkActor.newInstance(); actor.setMapper(mapper);
renderer.addActor(actor);
// ----------------------------------------------------------- // Make some variables global so that you can inspect and // modify objects in your browser's developer console: // -----------------------------------------------------------