Yes, thank you! This was very helpful.
Code:
from ngsolve import *
import netgen.geom2d as geom2d
geo = geom2d.SplineGeometry()
p1 = geo.AppendPoint(1, 0, hpref=1)
p2 = geo.AppendPoint(0, 0, hpref=1)
p3 = geo.AppendPoint(0, -1, hpref=1)
p4 = geo.AppendPoint(-1, -1, hpref=1)
p5 = geo.AppendPoint(-1, 0, hpref=1)
p6 = geo.AppendPoint(-1, 1, hpref=1)
p7 = geo.AppendPoint(0, 1, hpref=1)
p8 = geo.AppendPoint(1, 1, hpref=1)
# Seems sensitive to direction/order of splines; this configuration works
geo.Append (["line", p2, p1], hpref=1, bc=1)
geo.Append (["spline3", p1, p8, p7], hpref=1, bc=1)
geo.Append (["spline3", p7, p6, p5], hpref=1, bc=1)
geo.Append (["spline3", p5, p4, p3], hpref=1, bc=1)
geo.Append (["line", p3, p2], hpref=1, bc=1)
ng_mesh = geo.GenerateMesh (maxh=.125)
mesh=Mesh(ng_mesh)
# mesh.Curve(2) # Curved elements
mesh.RefineHP(2,.25)
Draw(mesh)