question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jupyter widget problem: pythreejs

See original GitHub issue

I try a simple example of pyvista in a jupyter notebook, but there is no rendering. Instead, I get the following error message in the terminal: [W 10:09:59.253 NotebookApp] 404 GET /static/ipygany.js?v=20210929100904 (::1) 1.600000ms referer=http://localhost:8833/notebooks/create-poly.ipynb


import numpy as np
import pyvista as pv

# mesh points
vertices = np.array([[0, 0, 0],
                     [1, 0, 0],
                     [1, 1, 0],
                     [0, 1, 0],
                     [0.5, 0.5, -1]])

# mesh faces
faces = np.hstack([[4, 0, 1, 2, 3],  # square
                   [3, 0, 1, 4],     # triangle
                   [3, 1, 2, 4]])    # triangle

surf = pv.PolyData(vertices, faces)

# plot each face with a different color
surf.plot(scalars=np.arange(3), cpos=[-1, 1, 0.5])

System Information: Please run the following code wherever you are experiencing the bug and paste the output below. This report helps us track down bugs and it is critical to addressing your bug:

--------------------------------------------------------------------------------
  Date: Wed Sep 29 10:13:44 2021 MDT

                OS : Darwin
            CPU(s) : 16
           Machine : x86_64
      Architecture : 64bit
       Environment : Jupyter
        GPU Vendor : ATI Technologies Inc.
      GPU Renderer : AMD Radeon Pro 5500M OpenGL Engine
       GPU Version : 4.1 ATI-3.10.22

  Python 3.9.2 (default, Feb 19 2021, 17:09:53)  [Clang 12.0.0
  (clang-1200.0.32.29)]

           pyvista : 0.32.1
               vtk : 9.0.3
             numpy : 1.20.1
           imageio : 2.9.0
           appdirs : 1.4.4
            scooby : 0.5.7
            meshio : 4.4.6
        matplotlib : 3.3.4
           IPython : 7.28.0
        ipyvtklink : 0.2.1
             scipy : 1.6.1

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
akaszynskicommented, Oct 6, 2021

by the way, opacity and plotting polydata that has only points and no triangles also seems buggy on my end using pythreejs.

Jupyterlab plotting using pythreejs is in super-beta, so it’s no surprise that it’s broken. If you find specific bugs, could you please post a minimum working example here so we can patch it?

0reactions
dstansbycommented, Nov 18, 2021

The reason for this is we’ve disabled “double side plotting” within pythreejs. I can enable this, but it’s generally not advisable as it can cause plotting artifacts for complex meshes. Probably what we need to add is options for pythreejs.

Is there a way to enable it from the user end? I’ve just spend a while getting quite confused about only one side of the mesh being rendered by pythreejs, when both sides are rendered in a ‘normal’ pyvista plot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pythreejs - PyPI
Interactive 3D graphics for the Jupyter Notebook and JupyterLab, using Three.js and Jupyter Widgets.
Read more >
jupyter-threejs - npm
Repository. github.com/jupyter-widgets/pythreejs ; Homepage. github.com/jupyter-widgets/pythreejs#readme ; Version. 2.4.0 ; License. BSD-3-Clause ...
Read more >
Binder - MyBinder
Error loading jupyter-widgets/pythreejs/master! See logs below for details. New to Binder? Check out the Binder Documentation for more information.
Read more >
pythreejs — pythreejs 2.4.1 documentation
pythreejs is a Jupyter widgets based notebook extension that allows Jupyter to leverage the WebGL capabilities of modern browsers by creating bindings to...
Read more >
Using pythreejs with PyVista
The pythreejs jupyterlab plotting backend is a powerful library that enables ... this backend to display PyVista scenes directly within a jupyter notebook, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found