-
Notifications
You must be signed in to change notification settings - Fork 268
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
K3d freezes Jupyter notebook after showing a mesh #73
Comments
@panangam from vtkplotter import embedWindow
embedWindw(False) it is a bit strange though that it take so long.. |
Thank you! Let me see if I can make a reproducible code to show the slowness. |
This is all I'm doing in Jupyter import trimesh
import vtkplotter
body_mesh = trimesh.load_mesh('censored_scan.obj')
vtkplotter.show(body_mesh) Took about 10 seconds to display with k3d. If I use Trimesh's threejs viewer, it loaded instantly. Here's the mesh file I'm using: |
Interesting. I duplicated your code here, and it took about 1 second for the display to show up. However, my Jupyter screen froze for about 10 seconds after that before I could do anything else. A different notebook in a different tab froze at the same time as well. As for running the code in normal Python console, I could instantly interact with the new window that popped up, showing my mesh. This is probably not a vtkplotter issue, so we can close this. I'd appreciate any suggestion for what to check though. |
Uhmm, I would maybe check some of the k3d standard examples to see if the problem is still there. |
k3d examples didn't give me any trouble. In fact, doing body_mesh = trimesh.load_mesh('censored_scan.obj')
plt = k3d.plot()
mesh = k3d.mesh(body_mesh.vertices, body_mesh.faces)
plt += mesh
plt.display() also showed the result instantly... Weird. |
that sounds weird indeed because if show() returns in 0.7 sec i cannot think of anything that would slow down the execution afterwards. |
Update.
Also, vtkplotter scene seems to look a bit smoother. Do you use a different shader? |
Hi @panangam I think I found the problem in the way vertices receive their color individually. Now the color is uniform and can be changed from the dropped down menu. The smoother appereance is only due to the flat_shading option shown in the 2 cases. |
This worked perfectly for me, thank you! I'm still surprised your machine could actually still run the scene smoothly with all the vertex colors. To clarify, did vtkplotter use to assume that all meshes come with a color for each vertex? Another tangent question. Is there a way to show the plot so that Z-axis is pointing up? |
indeed that was causing the problem! the mystery is not completely solved as you say it might show up again when rendering multi colored meshes. You may check what happens if you run any of these examples
you can try with |
Tried the same example above, and was fast as well. My info box says
Are these the versions of vtkplotter or the Python it's using? I'm actually running this on Python 3.7. |
I think you are using latest version of k3d whereas i'm using an older one.. not sure if this can explain the initial problem.. I'll leave the issue open in case I find a better explanation.. |
I am using vtkplotter with Trimesh in Jupyter notebook, but the k3d display takes about 5 seconds to load every time I run the cell with the
show
command. So I want to disable the k3d display and just use the default separate window. Right now I do this by uninstalling k3d from my Python environment. Is there a better way?The text was updated successfully, but these errors were encountered: