Open JagnDC opened 1 year ago
@JagnDC The Vector3
class in pythreejs is a "trait" used with the config system from the traitlets
package. It is not mean to be instantiated directly, but rather assigned as a class variable in a HasTraits
class. Would you mind explaining what you are trying to do, and why simply using a tree-valued tuple (e.g. (1, 2, 3)
) isn't sufficient?
I'm trying to use the Vector3 class from PyThreeJS to represent 3D vectors in my Python code, but I keep getting a TypeError when trying to create a new Vector3 object. Here's the relevant code snippet:
”“” from pythreejs import Vector3 vec1 = Vector3(1, 2, 3) print("Vector 1:", vec1) “”“
When I run this code, I get the following error message:
”“” TypeError: init() takes from 1 to 3 positional arguments but 4 were given I have already updated PyThreeJS to the latest version, but the error persists. I'm running Python 3.7.16 on Windows 10. “”“
Can someone please help me resolve this issue? Thank you in advance for your help!
Steps to reproduce:
Expected result:
Actual result:
Environment:
PyThreeJS version: 2.4.2 Python version: 3.7.16 Operating system: Windows10