… could it be to write an algorithm that simply checks if vertices are connected?
A stupid step just killed my Wilga:
if (VerticeX(n) == VerticeZ(n+1) && VerticeY(n) == VerticeY(n+1))
{
if (VerticeZ(n) != VerticeZ(n+1))
{
float VerticeZTemp = VerticeZ(n) + VerticeZ(n+1) / 2;
VerticeZ(n) = VerticeZTemp;
VerticeZ(n+1) = VerticeZTemp;
}
}
Not that complicated, I would say.