Trying to determine edge orientation using Python API

I am trying to determine the orientation of an edge using the Python API.

According to the documentation there are functions:

geompy.GetFirstVertex()

geompy.GetLastVertex()

which return the first and last vertex of an edge or wire according to its orientation. But this is not the case because on the GEOM GUI when enabling the display of the direction of edges these vertices may not be corresponding to the first and last according to the direction of the edge.

If I explode the edge to its two forming vertices then again their order does not always conform to the orientation of the edge as displayed on the GEOM GUI.

Is there any way from the Python API to determine the direction / orientation of an edge in order to know for certain which vertex comes first and which last?

Hello,

I remember reading (can not remember if the github release notes or somewhere else) that first and last vertex do not work properly. What I do that works almost all the time is

Get the vertex with subshapes. Then with the edge create a vertex on the edge at 0.01 fraction of it and use take orientation to true. Then check the distances to the two vertex. This worked flawlessly for me, it is a little bit more calculation heavy but it works.