This is the figure for pillbox integration volume that was used in the boundary value analysis of Maxwell’s equations.

<<peeters` ;
peeters`setGitDir[ "../project/figures/GAelectrodynamics" ]

ClearAll[bold,fs,e1,e2,e3,o,f,xx,xy, n, p, p2]
bold = Style[ #, Bold] &;
fs := Style[ #, FontSize-> 14]&;
{e1,e2,e3} = IdentityMatrix[3];
o = {0,0,0};
f[x_, y_] :=  0.5Sin[x]Exp[-y] Cos[3y];
xx[x_,y_] := e1+e3 D[f[a,b],a] /. {a -> x,b -> y};
xy[x_,y_] := e2+e3 D[f[a,b],b] /. {a -> x,b -> y};
n[x_,y_] := Cross[ xx[x,y] ,xy[x,y] ] // Normalize;
nt := fs[Subscript["n"// bold, #]]&;
p[x_,y_, z_] := {x,y,f[x,y]+z};
p2 = Module[{ r1, zr,rr, r},

r1 = 0.3;
zr = 5;
rr = 0.7{-1,1};
r = 0.2;

Show[{
Plot3D[ f[x,y], {x,-1,1}, {y, -1,1}, PlotRange -> {rr, rr, rr}, Ticks-> None,
PlotStyle->Directive[Opacity[0.6], Blue],BoxRatios->Automatic(*,Boxed -> False*)
],
Plot3D[r1+ f[x,y], {x,-1,1}, {y, -1,1},  Ticks-> None,
PlotStyle->Directive[Opacity[1]],
RegionFunction->Function[{x,y,z},x^2 + y^2 < r^2]
]
,
Plot3D[-r1+ f[x,y], {x,-1,1}, {y, -1,1},  Ticks-> None,
PlotStyle->Directive[Opacity[1]],
RegionFunction->Function[{x,y,z},x^2 + y^2 < r^2]
],
ParametricPlot3D[ r{Cos[t],Sin[t],z},{t,0,2Pi}, {z,-20,20},RegionFunction->Function[{x,y,z},z < r1+f[x,y] && z > -r1 + f[x,y]]
]
,
Graphics3D[ {
Text[2// fs//bold,p[-1/3,-1/3,2r1]],
Text[1// fs//bold,p[-1/3,-1/3,-1.5r1]],
Arrowheads[0.019],
Blue,
Arrow[Tube[{p[0,0,r1], p[0,0,r1]+r1 n[0,0]}]],
Arrow[Tube[{p[0,0,-r1], p[0,0,-r1]-r1 n[0,0]}]],
Black,
Text[nt[2],p[0,0,r1]+1.2r1 n[0,0]],
Text[nt[1],p[0,0,-r1]-1.2r1 n[0,0]]
} ]
}
]
]

peeters`exportForLatex["pillboxIntegrationVolumeFig1", p1]