Is there something wrong with “earcut” ???
In this PG , if you change line 15 createMesh1 to createMesh2,
you can find that , If the points given are in the xoz plane, the graph cannot be drawn correctly
Or maybe Earcut has some rules that I don’t know about
Or you could help me fix the case