# Combine Plot and Graphics 3D for open box

I've been trying to code up an infinite waveguide. To do so, I need to build an open box and overlay several trigonometric functions onto the same set of axes. As someone fairly new to Mathematica, I figured combining the "Graphics3D"and "Plot" functions could work. Is this feasible, or would you suggest an alternative?

The final product should look something like this:
(http://www.radartutorial.eu/03.linetheory/Waveguides.en.html).

Thanks!

• Is there any chance that you might be able to find a fairly simple image somewhere on the web that looks similar to what you would like to construct? And then append that image onto your question?
– Bill
Commented Aug 21, 2018 at 21:00
• Thanks, Bill. Good point Commented Aug 21, 2018 at 21:38
• Try tweaking this Plot3D[Sin[x] Cos[y], {x,0,10 Pi}, {y,-Pi/2,Pi/2}, ColorFunction-> Function[{x,y,z}, Hue[-z]], PlotPoints->200, AspectRatio->1/2]
– Bill
Commented Aug 21, 2018 at 22:29
• You can combine multiple graphics into a single image using Show
– Bill
Commented Aug 21, 2018 at 22:36

## 1 Answer

Perhaps this will get you started. I'm not sure how faithfully you would like the image reproduced. For the waveguide, you can use FaceForm to make one side translucent/transparent. If the frame as shown is important, you'll have to add more polygons to the graphics. For a thin edge, you can use EdgeForm, but if you make the edges thick, they don't match up at the corners of the box.

Show[
Plot3D[Cos[x] Sin[2 y], {x, -π/2, π/2}, {y, 0, 9 π/2},
ColorFunction -> (ColorData["Rainbow"][#3] &),
MaxRecursion -> 3, Mesh -> None,
BoxRatios -> Automatic, Boxed -> False, Axes -> False],
Graphics3D[
GraphicsComplex[
Tuples[N@{{-π/2, π/2}, {0.3, (9 π)/2 - 0.3}, {-1, 1}}],
{FaceForm[
Directive[RGBColor[0.7, 0.6, 0.2], Opacity[0.2]],
Directive[RGBColor[0.7, 0.6, 0.2], Opacity[1]]],
Polygon[{{1, 2, 4, 3}, {7, 8, 6, 5}, {1, 3, 7, 5}, {2, 6, 8, 4}}]
}
]]
]