-
Notifications
You must be signed in to change notification settings - Fork 54
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
Decimate does not work well with three.js #60
Comments
@bcipolli -- So that I'm clear, do you believe that the decimation function is saving the files in a format not compatible with three.js, and that reading/rewriting (with explode_scalars() or with read_vtk()/write_vtk()) results in a three.js-amenable format? |
@binarybottle Yes, that's my belief. |
Perhaps writing out the vtk file using vtk.vtkPolyDataWriter() in the decimate() function might not be the way to go. I'm not sure what to replace it with, but given that you found a workaround, would you mind submitting a pull request to include the read/rewrite so that the output of the function will behave well for future roygbiv/three.js work? Were you able to do so for files with multiple labels? |
If I
decimate
the individual ROI surfaces, parse usingVTKLoader.js
and try to display viathree.js
, I get about 33% of the surfaces having invalid vertex indices that cause a javascript error (see below):(note: If I
![image](https://cloud.githubusercontent.com/assets/4072455/10339723/b306a6a8-6cc1-11e5-8b4c-2c8e1b25a59a.png)
decimate
the label vtk beforeexploding
into ROIs, I don't have the problem, but the result doesn't look great):This is either an issue with
decimate
or theVTKLoader
code. @binarybottle could you help debug? A script to reproduce this issue is attached at the bottom (requiresflask
)The text was updated successfully, but these errors were encountered: