<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Salut Nicolas,</p>
    <p>I think I added this very strange hack when I ported my old
      python code (with other geometry functions that were not or
      slightly different from QgsGeometryUtils). However, I have no
      memory of why.<br>
      <br>
      You can open an issue and assign it to me, I will try to find that
      old code and fix it. We can discuss this later this week.</p>
    <p>Loïc<br>
    </p>
    <div class="moz-cite-prefix">Le 04/12/2021 à 20:32, Nicolas Godet a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:PA4P190MB1166BBB2E3B4D2221BEB8CBB8F6B9@PA4P190MB1166.EURP190.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">A workaround would be to add 90° to the lowest
        value if the sum is lower than 180°.</div>
      <div dir="ltr"><a
href="https://github.com/Artelia/Mesh_tools/commit/5d40a8807f1c8264ccff51b365ce8d58ac333011"
          moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/Artelia/Mesh_tools/commit/5d40a8807f1c8264ccff51b365ce8d58ac333011</a></div>
      <div dir="ltr"><br>
      </div>
      <div dir="ltr">That’s not ideal, especially in case of very flat
        triangle…</div>
      <div dir="ltr"><br>
      </div>
      <div dir="ltr"><br>
        <blockquote type="cite">Le 4 déc. 2021 à 19:52, Nicolas Godet
          <a class="moz-txt-link-rfc2396E" href="mailto:nicolas.godet@outlook.fr"><nicolas.godet@outlook.fr></a> a écrit :<br>
          <br>
        </blockquote>
      </div>
      <blockquote type="cite">
        <div dir="ltr">
          <div dir="ltr">Seems an issue more than a feature to me.</div>
          <div dir="ltr">At least, the doc should reflect this behavior.</div>
          <div dir="ltr"><br>
          </div>
          <div dir="ltr">Should I open a issue on GH ?</div>
          <div dir="ltr"><br>
            <blockquote type="cite">Le 4 déc. 2021 à 19:45, Andrea
              Giudiceandrea <a class="moz-txt-link-rfc2396E" href="mailto:andreaerdna@libero.it"><andreaerdna@libero.it></a> a écrit :<br>
              <br>
            </blockquote>
          </div>
          <blockquote type="cite">
            <div dir="ltr"> Il 04/12/2021 13:52, Nicolas Godet ha
              scritto:<br>
              <blockquote type="cite"
cite="mid:PA4P190MB11665DEECE547DE4FF0343508F6B9@PA4P190MB1166.EURP190.PROD.OUTLOOK.COM">>>>
                triangle.angles()
                <div style="font-family: Calibri, Helvetica, sans-serif;
                  font-size: 12pt; color: rgb(0, 0, 0);">
                  <div>[0.7119509950830287, 0.0008857138004074727,
                    0.85795961791146]</div>
                  <div>>>> [math.degrees(a) for a in
                    triangle.angles()]</div>
                  [40.79178723839677, 0.05074766261984076,
                  49.157465098983366]<br>
                </div>
                <br>
                <div style="font-family: Calibri, Helvetica, sans-serif;
                  font-size: 12pt; color: rgb(0, 0, 0);">
                  We should have a near-90° angle, which we don't...</div>
              </blockquote>
              <br>
              Hi Nicolas,<br>
              it seems the QgsTriangle::angles() fails to correctly
              return the value of angles greater than 90° deg. (Pi/2
              rad.).<br>
              <br>
              Actually the function code strangely subtract 90 to such
              angles:<br>
              <br>
              <a class="moz-txt-link-freetext"
href="https://github.com/qgis/QGIS/blob/dd0cd13a00998bc153c0b6519ea75038b57a6df5/src/core/geometry/qgstriangle.cpp#L397-L403"
                moz-do-not-send="true">https://github.com/qgis/QGIS/blob/dd0cd13a00998bc153c0b6519ea75038b57a6df5/src/core/geometry/qgstriangle.cpp#L397-L403</a><br>
                angles.append( ( a1 > M_PI_2 ? a1 - M_PI_2 : a1 ) );<br>
                angles.append( ( a2 > M_PI_2 ? a2 - M_PI_2 : a2 ) );<br>
                angles.append( ( a3 > M_PI_2 ? a3 - M_PI_2 : a3 ) );<br>
              <br>
              In fact, the correct value of the angle is
              90.05074766261984076 deg. and not 0.05074766261984076.<br>
              <br>
              Regards.<br>
              <br>
              Andrea<br>
              <span>_______________________________________________</span><br>
              <span>QGIS-Developer mailing list</span><br>
              <span><a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a></span><br>
              <span>List info:
                <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></span><br>
              <span>Unsubscribe:
                <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></span><br>
            </div>
          </blockquote>
        </div>
      </blockquote>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
QGIS-Developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
    </blockquote>
  </body>
</html>