Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VTK Parser throws unhandled exception when trying to load empty mesh file #212

Open
chucksspencer opened this issue Oct 31, 2019 · 0 comments

Comments

@chucksspencer
Copy link

chucksspencer commented Oct 31, 2019

Hi there. We're attempting to use this library as part of an automated process that sometimes emits empty .vtk files. When we attempt to add a X.mesh from one of these empty .vtk files into a renderer3D object, the parser is throwing an unhandled error.

The do-while loop on line 442 of parserVTK.js doesn't check to see if the _geometries array is empty at the top of the loop - resulting in an error trying to access the length property of undefined on line 446.

I tried switching it to a while loop, and I also tried just returning if the _geometries array is empty - but in both cases it seemed to break other things - there are side effects happening that I don't understand.

It's worth noting that in our case this mesh is a child object of a parent mesh.

It'd be great to check the .vtk file to see if the mesh is empty, but since the Mesh object isn't really initialized until this parsing happens (and the exception happens), we're having trouble figuring out a good way to check the file. Ideas welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant