Skip to content
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

Error when changing Camera #438

Open
pytunia opened this issue Jun 28, 2023 · 2 comments
Open

Error when changing Camera #438

pytunia opened this issue Jun 28, 2023 · 2 comments

Comments

@pytunia
Copy link

pytunia commented Jun 28, 2023

Hi everyone,

according to https://ipyvolume.readthedocs.io/en/latest/pythreejs.html#Camera "other cameras should also work".
So I tried the following in my jupyter notebook:

fig = ipv.figure()
newcamera = pythreejs.OrthographicCamera()
fig.camera = newcamera
mesh = ipv.plot_wireframe(Xt, Yt, Zt)
VBox([ipv.gcc()])
ipv.show()

I end up getting these errors:

0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[E 09:23:36.605 NotebookApp] Uncaught exception, closing connection.
    Traceback (most recent call last):
      File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\iostream.py", line 695, in _handle_events
        self._handle_write()
      File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\iostream.py", line 965, in _handle_write
        self._write_buffer.advance(num_bytes)
      File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\iostream.py", line 182, in advance
        assert 0 < size <= self._size
               ^^^^^^^^^^^^^^^^^^^^^^
    AssertionError
Exception in callback None()
handle: <Handle cancelled>
Traceback (most recent call last):
  File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\platform\asyncio.py", line 192, in _handle_events
    handler_func(fileobj, events)
  File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\iostream.py", line 695, in _handle_events
    self._handle_write()
  File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\iostream.py", line 965, in _handle_write
    self._write_buffer.advance(num_bytes)
  File "C:\Users\User01\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\iostream.py", line 182, in advance
    assert 0 < size <= self._size
           ^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Not sure what to do with that. Any help is greatly appreciated.

Thanks!

@maartenbreddels
Copy link
Collaborator

Hi,

did you tree without this camera? I've seen this error and I think it is not related. I think the issue is an incompatible tornado version for jupyter.

Regards,

Maarten

@pytunia
Copy link
Author

pytunia commented Jun 28, 2023

Hi Maarten,

the plot does work without these two lines:

#newcamera = pythreejs.OrthographicCamera()
#fig.camera = newcamera

Actually the change of the camera (orthographic) just causes a blank output, where the plot should be.

Edit:
So I did a little more digging. And I think it has to do with some nan's in fig.camera.projectionMatrix.
After some more strategic investigation I got the following error:

TraitError: The 'matrix_projection' trait of a Figure instance contains a CFloat of a List which expected a float, not the NoneType None.

camera_test4

It could be related to #40 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants