Windows line endings in vtk file

Hi,
I read legacy vtk file with vtkPolyDataReader, but the file has CR LF line endings, and the action fails.

Should the vtk file contain LF endings per spec, or is it a sort of bug of vtk.js:
content.split('\n')

1 Like

It is a bug in vtk.js but the legacy reader in vtk.js has a lot of limitation as it was not fully implemented. If you can, it will be better to use the vtp or vti format.

Although if the legacy format is the only way to go, fixing the reader and adding the missing features should not be too bad.

Oh, I looked at the code, it seems this is fixed. I had an older version.

But… I do not have vtk.js file now when I build with npm run build -- -p. Should I? Is something changed in the build process?

If you want to build for release you should execute npm run build:release which should produce a vtk.js and vtk-lite.js file inside the dist/ directory.

Also the generated files can be available here as well https://unpkg.com/vtk.js

Looking at it, show that the dev build does indeed does not produce any file on the disk.

Thanks, it did the trick. It seems that information is outdated about building on Windows on the web page (https://kitware.github.io/vtk-js/docs/develop_build.html)

Indeed, thanks for pointing that out…
I just pushed a fix, the website should update in the coming hour.