Im generating a 2d Mesh from points i previously scattered, but sometimes the mesh turns out screwed up with some triangles getting 2 indices right but the last one in some random index, being that triangle outside the premise of the delaunay formula.


The code im using to draw the segments:
var triangles = Geometry.triangulate_delaunay_2d(PoolVector2Array(points))
for tri in range (triangles.size()/3):
var tri_n = tri*3
var a = triangles[tri_n]
var b = triangles[tri_n+1]
var c = triangles[tri_n+2]
var triseg = [[a,b],[a,c],[b,c]]
segments += triseg
I have not seen any specific pattern for this to occur so i'm asking here if this is a common problem or if there is a workaround.
Thank you :)