angeloskath / simple-3dviz

A library for 3D visualization with moderngl
http://simple-3dviz.com/
Other
133 stars 22 forks source link

NotImplementedError #14

Closed YandanYang closed 1 year ago

YandanYang commented 1 year ago

Hi, I got the following error when running the example scripts. Do you know how to fix this problem?


>>> from simple_3dviz import Mesh
>>> from simple_3dviz.window import show
>>> from simple_3dviz.utils import render
>>> m = Mesh.from_file("window_7_0.obj")
>>> vertices, faces = m.to_points_and_faces()
>>> show(m, camera_position=(-60., -160, 120), camera_target=(0., 0, 40),
...      light=(-60, -160, 120))
NotImplementedError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yandan/anaconda3/envs/atiss/lib/python3.8/site-packages/simple_3dviz/window/__init__.py", line 68, in show
    w.show(title)
  File "/home/yandan/anaconda3/envs/atiss/lib/python3.8/site-packages/simple_3dviz/window/wx.py", line 184, in show
    frame = self._Frame(self, self.size, title)
  File "/home/yandan/anaconda3/envs/atiss/lib/python3.8/site-packages/simple_3dviz/window/wx.py", line 23, in __init__
    self.view = Window._Canvas(self._window, self)
  File "/home/yandan/anaconda3/envs/atiss/lib/python3.8/site-packages/simple_3dviz/window/wx.py", line 37, in __init__
    super(Window._Canvas, self).__init__(
SystemError: <method-wrapper '__init__' of _Canvas object at 0x7f5abd5e91f0> returned a result with an error set
paschalidoud commented 1 year ago

Hi @YandanYang,

In order for me to be able to figure this out I will need some more information regarding your setup. Can you please share with me the wxpython, simple-3dviz and opengl version that you are using? Moreover, are you running the example scripts on a hedless server or on a laptop/pc with a display?

Best, Despi

YandanYang commented 1 year ago

I am running on Ubuntu 22.04 with a display. Here are the details:

simple_3dviz='0.7.0' wxpython=4.2.0 OpenGL version string: 4.6.0 NVIDIA 525.105.17

paschalidoud commented 1 year ago

This seems weird.

I am using simple-3dviz without any issues on an Ubuntu machine with python 3.9.16. Just for reference, my wxpython version is same as yours and my moderngl's version is 5.8.2. Can you share with me the obj file that you are trying to visualize (window_7_0.obj) ?

Best, Despi

YandanYang commented 1 year ago

I check the version of moderngl, it is 5.8.2. And python 3.9.16 does not work on my PC as well. I have send the obj file to your email. But I think it is not the fault of the obj file. Cause my laptop with windows system works well with this file in simple-3dviz.

YandanYang commented 1 year ago

I have solved the problem. I just degrade wxpython from 4.2.0 to 4.1.0.