vedo: K3d freezes Jupyter notebook after showing a mesh

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?

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

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?

Update.

  1. I replicated the same behavior in Chrome, Safari, and Firefox on Mac OSX 10.14.5 so it’s not a browser specific issue.
  2. Compared to my bare bone k3d mesh object, the vtkplotter-generated scene has a bunch of extra values associated with the mesh, along with a mysterious yellow color. Whenever I try to change any of the value, my notebook freezes up again as well. Seems like vtkplotter might generated a bunch of extra information that is being recalculated every render. Thoughts?

Also, vtkplotter scene seems to look a bit smoother. Do you use a different shader?

Screen Shot 2019-11-20 at 2 03 44 PM Screen Shot 2019-11-20 at 2 05 06 PM

that sounds weird indeed because if show() returns in 0.7 sec i cannot think of anything that would slow down the execution afterwards. I reopen the issue in case of any further hints/ideas…

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.

Thank you! Let me see if I can make a reproducible code to show the slowness.