<div dir="ltr"><div>Hi,</div><div><br></div><div>The triangular mesh of mesh layer is not accessible from the python API, only from the C++ API.</div><div><br></div><div>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 : <br></div><div><a href="https://qgis.org/pyqgis/master/core/QgsMeshDataSourceInterface.html#module-QgsMeshDataSourceInterface">https://qgis.org/pyqgis/master/core/QgsMeshDataSourceInterface.html#module-QgsMeshDataSourceInterface</a></div><div><br></div><div>Vincent<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 30 juin 2020 à 12:23, Jorge Almerio <<a href="mailto:jorgealmerio@yahoo.com.br">jorgealmerio@yahoo.com.br</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="PT-BR"><div class="gmail-m_-3750308592243979914WordSection1"><p class="MsoNormal">Hi devs,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US">I still can not get the triangular mesh from a Mesh Layer using Qgis version 3.14.0-Pi.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">The triangularMesh() attribute is present in the API documentation<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><a>https://qgis.org/api/classQgsMeshLayer.html#ae5d4ae367cfbd2abf6920d26701f0143</a>. <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">But I get an Error:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">AttributeError: 'QgsMeshLayer' object has no attribute 'triangularMesh'<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">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.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">My code below returns<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">AttributeError: 'QgsMeshLayer' object has no attribute 'triangularMesh'<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">proj = QgsProject.instance()<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">mdtLyr = proj.mapLayersByName("RA04_Surface")[0]<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">mdtLyr.updateTriangularMesh()<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">triang = mdtLyr.triangularMesh()<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Jorge Almerio<u></u><u></u></span></p></div></div>_______________________________________________<br>
QGIS-Developer mailing list<br>
<a>QGIS-Developer@lists.osgeo.org</a><br>
List info: <a rel="noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a rel="noreferrer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div>