Details
Description
The only way to create QSurfaceDataArray to pass to the QSurfaceDataProxy object is via a nested for loop that creates for every point a QVerctor3D object. For bigger arrays like 300x300, this takes extremely long and for real time use it is in my case too slow.
My code to generate a QSurfaceDataArray or in the Surface Example:
def parse_data(data: np.ndarray): global vector_list for y_index in range(data.shape[0]): for x_index in range(data.shape[1]): vector_list[y_index][x_index] = QVector3D(x_index, data[y_index, x_index], y_index)
The vector_list is after the generation passed to the QSurfaceDataProxy.setRows function. I think the problem is, that the list must contain QVector3D objects and therefore no direct conversion with numpy or python functions is possible.
It would be nicer and probably much faster, if a numpy ndarray (2D or 3D) could be passed directly as a QSurfaceDataArray, or a conversion function would exist.
typedef QList<QSurfaceDataItem> QSurfaceDataRow;
typedef QList<QSurfaceDataRow *> QSurfaceDataArray;
QSurfaceDataItem::QSurfaceDataItem(const QVector3D &position);
Attachments
Issue Links
- relates to
-
PYSIDE-1503 QLineSeries.replace (Qt Charts) performance issue
- Closed
-
PYSIDE-1540 QPainter.drawPoints performance issue
- Closed
-
PYSIDE-2313 Numpy: QLineSeries.appendNp accepts arrays, but doesn't append
- Closed