Mesh with SW-NE diagonals

Hi,everyone! I want to generate a mesh with SW-NE diagonals(below a code for mesh with WN-ES diagonals).
###############################from ngsolve import *
import ngsolve.meshes as ngm
import netgen.geom2d as geom2d
from netgen.geom2d import SplineGeometry

i = 2
mapping = lambda x,y : (x,y)
mesh = ngm.MakeStructured2DMesh(quads=False, nx = 2i ,ny = 2i, mapping=mapping)
Draw(mesh)

Best
Shasha Wang

Hi Shasha,

you can use the flip_triangles keyword argument for this, i.e, mesh = ngm.MakeStructured2DMesh(quads=False, nx = 2i ,ny = 2i, flip_triangles=True).

Best wishes,
Henry