Hi,
I am trying to develop a complete STL file Viewer which use PyROOT and OpenGL.
After some researchs i found the triangleset tutorial : TEveTriangleSet Tutorial.
I tried to adapt it with python code (still using the same file as the tutorial : “broken_torus.tring”) but the viewer do not display.
Here is a MWE of my code :
import ROOT
import time
eveManager = ROOT.TEveManager(800,400)
triangleSet = ROOT.TEveTriangleSet.ReadTrivialFile("/usr/share/doc/root/tutorials/eve/broken_torus.tring")
triangleSet.SetName("test")
triangleSet.GenerateTriangleNormals()
triangleSet.GenerateRandomColors()
triangleSet.SetMainColor(0)
eveManager.AddElement(triangleSet)
eveManager.Redraw3D()
while triangleSet:
time.sleep(1)
Currently, i have two tracks :
I have to configure correctly the eveManager but i found no information in the root user guide (User guide)
The triangleset.c tutorial use a gEve field/instance (available at triangleSetTutorial and gEveLink) and i have no idea how to access it and what it is supposed to be.
Can you help me figure out where i did a mistake ?
Is there a better approach or another class, that could be better for my purpose of developping a *.stl/*.tring file viewer ?
gEve is global instance of TEveManager. Please call static TEveManager::Create() instead of direct constructor invocation.
There is no gEveLink that I know of
I never used python so I might be wrong … but isn’t your while loop at the bottom hogging the root even loop? TEveManager::Redraw3D() only schedules a redraw, it only happens when the event loop in root resumes.