itemsAt: how to get ID of a single face from the GLMeshItem item?

72 views
Skip to first unread message

igor...@gmail.com

unread,
Sep 7, 2016, 8:46:20 AM9/7/16
to pyqtgraph

Hello Luke,


I am looking for a tool to visualize and manipulate tetrahedral mesh. I have some experience with numpy, matplotlib but nothing with  opengl. With PyQtGraph you are doing a great job and pyqtgraph.examples helps to easily understand the functionality. I have a question about pyqtgraph.opengl.GLViewWidget.itemsAt. It takes the rectangular regions of interest and gives back the list of items which are currently inside.  But how can I get the ID of a single face from the mesh item?


Let me shortly explain. I display tetrahedral mesh (vertices, faces) like a single item using pyqtgraph.openg.GLMeshItem. And I want to click at a single face and to get it’s ID in order to, let's say, change the face color and  modify a numpy array which is linked to the face by the ID.

I tried to plot faces like a separate items but it works slow and itemsAt returns all the faces which are in the region of interest, while I need only the one which is closest to the user.


Could you please give me advice how can I effectively plot a huge mesh and get access to a single face by mouse click? Maybe I have not managed to explain properly. Please have a look at java script example which almost does what I tried to in Python using PyQtGraph.


Thank and best regards,

Igor.

Sven Verpoort

unread,
Oct 21, 2016, 8:03:32 PM10/21/16
to pyqtgraph
Hi Igor,

I am facing the same problem. Have you found a solution to pick a surface by a mouse click using OpenGL in PyQtGraph ?

Greetings 
Sven
Reply all
Reply to author
Forward
0 new messages