Hello,
I am trying to read .vtk data using vtk.js, and this data is uploaded by the user locally (this data is a 3D model), and I get the error as shown in the attached photo.
else if (isVTK) {
console.log("Attempting to read VTK file:", file[0]);
const reader = new FileReader();
reader.onload = (event) => {
const arrayBuffer = event.target.result;
const vtkReader = vtk.IO.XML.vtkXMLPolyDataReader.newInstance();
vtkReader.parseAsArrayBuffer(arrayBuffer);
const vtkData = vtkReader.getOutputData(0);
if (vtkData) {
handleVTKData(vtkData);
} else {
handleError(new Error("Failed to load VTK data"));
}
};
reader.onerror = handleError;
reader.readAsArrayBuffer(file[0]);
}