[QGIS-Developer] RES: QgsMeshLayer object has no attribute triangularMesh

Jorge Almerio jorgealmerio at yahoo.com.br
Wed Jul 1 04:48:05 PDT 2020


Hi,

 

Very good information!

Thank you, very much!

 

Jorgealmerio

 

De: Vincent Cloarec [mailto:vcloarec at gmail.com] 
Enviada em: terça-feira, 30 de junho de 2020 18:24
Para: Jorge Almerio <jorgealmerio at yahoo.com.br>
Cc: qgis-developer <qgis-developer at lists.osgeo.org>
Assunto: Re: [QGIS-Developer] QgsMeshLayer object has no attribute triangularMesh

 

Hi,

 

The triangular mesh of mesh layer is not accessible from the python API, only from the C++ API.

 

So for now, not possible to access directly to the triangular mesh from Python. It is possible to acces ro the native from  the provider, but it will not be in the map coordinates if different from the data : 

https://qgis.org/pyqgis/master/core/QgsMeshDataSourceInterface.html#module-QgsMeshDataSourceInterface

 

Vincent

 

Le mar. 30 juin 2020 à 12:23, Jorge Almerio <jorgealmerio at yahoo.com.br <mailto:jorgealmerio at yahoo.com.br> > a écrit :

Hi devs,

 

I still can not get the triangular mesh from a Mesh Layer using Qgis version 3.14.0-Pi.

The triangularMesh() attribute is present in the API documentation

https://qgis.org/api/classQgsMeshLayer.html#ae5d4ae367cfbd2abf6920d26701f0143. 

But I get an Error:

AttributeError: 'QgsMeshLayer' object has no attribute 'triangularMesh'

 

 

Is it possible to return the triangular mesh? I would like to use the triangular mesh for make an exact profile/cross section from the mesh using a polyline. The others plugins, like Crayfish and Profile tools does this profile using a defined interval offset, so it's accuracy depends on this interval.

 

My code below returns

AttributeError: 'QgsMeshLayer' object has no attribute 'triangularMesh'

:

proj = QgsProject.instance()

mdtLyr = proj.mapLayersByName("RA04_Surface")[0]

mdtLyr.updateTriangularMesh()

triang = mdtLyr.triangularMesh()

 

Best regards,

 

Jorge Almerio

_______________________________________________
QGIS-Developer mailing list
QGIS-Developer at lists.osgeo.org <mailto:QGIS-Developer at lists.osgeo.org> 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200701/48d2a354/attachment-0001.html>


More information about the QGIS-Developer mailing list