Some correction, remark the region number od meshS is the surface number non a volume number.
load "tetgen"
{
real hs = 0.1; // mesh size on sphere
int[int] N=[20,20,20];
real [int,int] B=[[-1,1],[-1,1],[-1,1]];
int [int,int] L=[[1,2],[3,4],[5,6]];
////////////////////////////////
meshS ThH = SurfaceHex(N,B,L,1);
meshS ThS =Sphere(0.5,hs,7,1); // "gluing" surface meshs to tolat boundary meshes
cout << " xxxx" << ThH.nv << " " << ThS.nv << endl;
meshS ThHS=ThH+ThS;
plot(ThHS);
// soory MeshS no mesh3 wrong ..
real voltet=(hs^3)/6.;
cout << " voltet = " << voltet << endl;
real[int] domaine = [0,0,0,1,voltet,0,0,0.7,2,voltet];
mesh3 Th = tetg(ThHS,switch="pqaAAYYQ",nbofregions=2,regionlist=domaine);
cout << "3d regions " << regions(Th) << endl;
cout << " Th 3d = (0,0,0) " << Th(0,0,0).region<< endl;
cout << " Th 3d = (0,0,0.7)" << Th(0,0,0.7).region<< endl;
plot(Th,wait=1);
}