def meshgrid_triangles(n):
 tri = []
 for i in range((n - 1)):
  for j in range((n - 1)):
   a = (i + (j * n))
   b = ((i + 1) + (j * n))
   c = (i + ((j + 1) * n))
   d = ((i + 1) + ((j + 1) * n))
   tri += [[a, b, d], [a, d, c]]
 return np.array(tri, dtype=np.int32)

def meshgrid_triangles ( n ) : tri = [ ] for i in range ( ( n - 1 ) ) : for j in range ( ( n - 1 ) ) : a = ( i + ( j * n ) ) b = ( ( i + 1 ) + ( j * n ) ) c = ( i + ( ( j + 1 ) * n ) ) d = ( ( i + 1 ) + ( ( j + 1 ) * n ) ) tri += [ [ a , b , d ] , [ a , d , c ] ] return np . array ( tri , dtype = np . int32 )
utility function .