How can I find out the correct order of vertices to create a quad face with bmesh? Let's say I have 4 vertices and want to create a quad face with bmesh.
Is there way to figure out the right order of the vertices to not get a face like this


But rather a face like this.
From 4 verts you can construct 6 edges: throw away 2 longest that don't share a vert and from there you get the correct vertex order.