3d graphics not rendering in Jupyter notebook

asked 2025-05-17 16:26:27 +0200

camarneiro gravatar image

I am using Sage inside WSL2 on Windows 11. I am using a Jupyter notebook through Firefox. When I try to run the following code

G = sphere((1, 1, 1), 1, color='blue')
G.show(viewer='threejs')

no plot shows up, and I get an error message in the terminal:

404 GET /nbextensions/threejs-sage/r122/three.min.js

I am still able to access the graphics menu (save as PNG/save as HTML/get camera/get viewpoint/close menu). If I choose to save as HTML and open the resulting file, I can see the interactive plot correctly.

On the other hand, the following code using tachyon works correctly directly on the notebook (but then the plot isn't interactive).

G = sphere((1, 1, 1), 1, color='blue')
G.show(viewer='tachyon')

Moreover, 2d plots such as the following work correctly as well.

penta = polytopes.regular_polygon(5)
penta.plot()

Could someone help me understand what the issue is here? I tried to search for similar questions, but I didn't manage to find a solution.

edit retag flag offensive close merge delete

Comments

Could you please indicate which version of SageMath you are using and how you installed in WSL2 ?

eric_g gravatar imageeric_g ( 2025-05-20 13:42:16 +0200 )edit