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
For Gerrit Dashboard: PYSIDE-1880 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
405886,4 | Add a minimal surface example | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
405962,3 | Surface example: Fix loading the image from a different path | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
405963,3 | Surface example: Brush up the code | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
405964,6 | Add a surface example using numpy arrays | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406004,1 | WIP: Port the surface example to use a QAbstractTableModel | dev | qt/qtdatavis3d | Status: ABANDONED | -2 | 0 |
406049,2 | Add a minimal surface example | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406050,2 | Add a minimal surface example | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406053,2 | Surface example: Fix loading the image from a different path | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406054,2 | Surface example: Fix loading the image from a different path | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406056,2 | Surface example: Brush up the code | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406057,2 | Surface example: Brush up the code | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406733,2 | Add a surface example using numpy arrays | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
406734,2 | Add a surface example using numpy arrays | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
407356,5 | WIP: surfacegraph example: Add controls to modify data | dev | pyside/pyside-setup | Status: DEFERRED | -2 | 0 |
407566,13 | Add a numpy overload for QSurfaceDataProxy.resetArray() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
407646,2 | libpyside: Add a debug operator for numpy arrays | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
407682,2 | libpyside: Add a debug operator for numpy arrays | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
407810,4 | libpyside: Add a simple view into a numpy array | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
408019,2 | Refactor the surface examples | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
408452,2 | Refactor the surface examples | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
408453,2 | Refactor the surface examples | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
408536,5 | PySide6: Rename the surface_numpy to surface_model_numpy | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
408537,5 | QtDataVisualization: Add an example for using a numpy array directly | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
408841,2 | libpyside: move pyside_numpy.cpp common headers to top | dev | pyside/pyside-setup | Status: ABANDONED | 0 | 0 |
409947,2 | PySide6: Rename the surface_numpy to surface_model_numpy | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |