Hi,
since the geometry is modeled by 3d objects and planes, you can not directly set the mesh size on an edge.
But you can restrict the mesh size in an arbitrary point. I would suggest a loop over points on the edge and using the "RestrictH(...)" function as in the following code.
Code:
from netgen.csg import *
cube = OrthoBrick(Pnt(-1,-1,-1),Pnt(1,1,1))
geo = CSGeometry()
geo.Add(cube)
maxh = 0.5
mp = MeshingParameters (maxh=maxh)
n = 40
for i in range(n+1):
loc_h = 2/n # edge length devided by number of points
mp.RestrictH(x=1,y=-1+i*loc_h,z=1,h=loc_h) # restrict local mesh size at a point
ngmesh = geo.GenerateMesh(mp=mp)
from ngsolve import *
Draw(Mesh(ngmesh))
Best
Christoph