Sphere.vtk PolyDataReader

Hello,

First of all, thank you for creating such a great library.

I am trying to run the PolyDataReader example. Unfortunately, it does not load correctly. I am fairly sure it has something to do with the localisation of sphere.vtk file.

What I did is I pasted the sphere example into the ./dist folder so that the path should be localhost:8080/sphere.vtk. Then this path is used in reader.setUrl:

reader.setUrl(‘localhost:8080/sphere.vtk’).then(() => {

when I run npm run build it is fine. Then npm start looks good. When opening the localhost in firefox I can see following in the debugger

It looks like the sphere.vtk is loaded but the error message is ‘no input’.

I have got a feeling that it is something to do with loading the local files. When the files are fetched from external resource for different examples then it works. Whenever I try to load .vtk file or any other from local drive it always complain.

I would appreciate any help with that.

Thank you,
Slaw

The “no input” error is likely because your mapper doesn’t have an input at the time of render. The reader’s output is guaranteed to exist in your promise then block, so you should add the actor/render the scene then.