Highly appreciated for your respond.

So, you saying that I should use polyline and path it to GLLinePlotItem? 
That will be cool but I don't know how to pass such construction (I 
couldn't find anything at pyqtgraph documentation which showing any example 
of polyline;  Documentation link 
<https://pyqtgraph.readthedocs.io/en/latest/3dgraphics/gllineplotitem.html> 
there 
just empty pages at documentation regarding this).

Could you please show me example (based on what I have in my code right 
now) how to implement polylines (basically in which form I should pass 
start and end coordinates (pl_line)  to numpy that it will be accepted by gl
.GLLinePlotItem) without errors?

Or maybe you know is there any way how I can pass rectangle based on 4 
points?


Thank You! 
 




On Sunday, March 29, 2020 at 12:19:37 PM UTC-7, Kenneth Lyons wrote:
>
> I'm guessing OpenGL is probably not the bottleneck here. Each 
> GLLinePlotItem is a Python object and each GLViewWidget.paintGL update 
> iterates over them. If there's any way to combine your lines into a mesh or 
> a single GLLinePlotItem, you'd probably see reasonable performance. As a 
> test, you could try plotting an equivalent number of points in a single 
> GLLinePlotItem and see if that brings the FPS up.
>
> I think the opengl module handles NaNs well. You might be able to "cut" a 
> single line into pieces by concatenating lines and inserting np.nan between 
> them.
>
> On Friday, March 27, 2020 at 12:34:43 AM UTC-7, Nick PV wrote:
>>
>>
>> I have a problem when openGLWidget *(on PyQt5 Qdialog form) *significantly 
>> slowing down for pan or rotate when it displaying more then 2-3 thousand 
>> lines (or thousand polygons) plotted in 3D space.
>>
>> Is there any technique to make it work smoothly (change refresh rate or 
>> anything what is applicable) or it's just how openGLWidget performs, that 
>> it is not capable to hold a big amount of independent lines?
>>
>> For note, I have very powerful PC with powerful discrete graphic card, so 
>> computer performance is not a case.
>>
>> Just for example (cut from a context code) I'm plotting lines in this way:
>>
>>
>> import pyqtgraph.opengl as gl 
>> from pyqtgraph.Qt import QtWidgets 
>> import numpy as np
>>
>> self.app = QtWidgets.QApplication(sys.argv) 
>> self.w = gl.GLViewWidget() 
>>
>>
>> pl_line = ([(1, 1, 1), (2, 2, 2)])  # [Start coordinates(X,Y,Z), End 
>> coordinates (X,Y,Z)]
>>
>> pl_line = np.array(pl_line)
>> newline = gl.GLLinePlotItem(pos=pl_line, color=red, width=1, 
>> antialias=False) # Regular line plotting
>>
>>
>> self.w.addItem(newline) 
>> self.w.show() 
>> self.app.exec()
>>
>> So, when I have even 500 lines on the 3D plot it's still smooth, but once I 
>> going beyond that up to 2 thousand of lines it's FPS drops to 3-5 FPS when 
>> I'm rotating the plot scene. 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/04058c10-e595-450e-9fbd-94789e618907%40googlegroups.com.

Reply via email to