skoch9 / meshplot

Plot 3D triangle meshes
GNU General Public License v3.0
142 stars 35 forks source link

offline mode: save as html not working #44

Open lei-shu opened 1 year ago

lei-shu commented 1 year ago

Hi,

I tried on several machines (Linux & MacOS) with several different versions of the packages (jupyter/pythreejs/etc), in offline mode, the "save as html" function seems not working at this moment (the html saved is fully white). What could be the problem?

Some error messages in the generated .html:

Thanks!

ciaovention commented 1 year ago

same here...

VGTHuang commented 1 year ago

Same here. Do you think it's due to updates of jupyter-widgets? I was using meshplot just fine till around two weeks ago and thats when the update happened.

scottcb commented 9 months ago

I am having the same issue (blank output when using the "offline" function). In addition, meshplot is not working within a jupyter notebook, either.

When I call

mp.plot(v, c=np.random.random((v.shape[0],3)))

I get a broken plot and the following Javascript error:

"[Open Browser Console for more detailed log - Double click to close this message] Model class 'RendererModel' from module 'jupyter-threejs' is loaded but can not be instantiated 1233/e/<@http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.ba1735fea70611ab4bc1.js?v=ba1735fea70611ab4bc1:1:32036"

This is in a fresh conda install, and a brand new conda environment where all I did was: conda install numpy scipy jupyterlab ipywidgets meshplot -c conda-forge

So I think something has changed upstream that has broken this repo.

VGTHuang commented 9 months ago

I am having the same issue (blank output when using the "offline" function). In addition, meshplot is not working within a jupyter notebook, either.

When I call

mp.plot(v, c=np.random.random((v.shape[0],3)))

I get a broken plot and the following Javascript error:

"[Open Browser Console for more detailed log - Double click to close this message] Model class 'RendererModel' from module 'jupyter-threejs' is loaded but can not be instantiated 1233/e/<@http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.ba1735fea70611ab4bc1.js?v=ba1735fea70611ab4bc1:1:32036"

This is in a fresh conda install, and a brand new conda environment where all I did was: conda install numpy scipy jupyterlab ipywidgets meshplot -c conda-forge

So I think something has changed upstream that has broken this repo.

I have created a temporary workaround to display (some of) scenes:

https://github.com/VGTHuang/meshplot_tempfix/blob/master/meshplot/Viewer.py

I replaced p3s.DirectionalLight with p3s.RectAreaLight which seems to have fixed the display error. It renders the scene sans the specular lighting. However I'm unable to fix the behaviour in jupyter mode:

image

while in offline mode it displays normally:

image

VGTHuang commented 1 month ago

The new version of ipywidgets seems to have solved the problem. 8.1.2 works for me