# How to show a contourplot within a region?

I want to make a cotourplot given by

con = ContourPlot3D[
Sin[x] Sin[y] + Sin[z] Sin[y] + Sin[x] Sin[z] + 1 ==
0.000001, {x, -2 \[Pi], 2 \[Pi]}, {y, -2 \[Pi],
2 \[Pi]}, {z, -2 \[Pi], 2 \[Pi]}];


with in a region given by

a = 1; b = \[Pi]/4; p1 = {{\[Pi], -3 b, -5 b}, {\[Pi], -5 b, -3 b}, \
{0, -7 b, -b}, {-\[Pi], -5 b, -3 b}, {-\[Pi], -3 b, -5 b}, {0, -b, -7 \
b}};
p2 = {{\[Pi], 5 b, 3 b}, {\[Pi], 3 b, 5 b}, {0, b, 7 b}, {-\[Pi], 3 b,
5 b}, {-\[Pi], 5 b, 3 b}, {0, 7 b, b}};
p3 = {{\[Pi], -3 b, -5 b}, {\[Pi], 5 b, 3 b}, {\[Pi], 3 b,
5 b}, {\[Pi], -5 b, -3 b}};
p4 = {{\[Pi], 3 b, 5 b}, {\[Pi], -5 b, -3 b}, {0, -7 b, -b}, {0, b,
7 b}};
p5 = {{0, -7 b, -b}, {0, b, 7 b}, {-\[Pi], 3 b,
5 b}, {-\[Pi], -5 b, -3 b}};
p6 = {{-\[Pi], 3 b,
5 b}, {-\[Pi], -5 b, -3 b}, {-\[Pi], -3 b, -5 b}, {-\[Pi], 5 b,
3 b}};
p7 = {{-\[Pi], -3 b, -5 b}, {-\[Pi], 5 b, 3 b}, {0, 7 b,
b}, {0, -b, -7 b}};
p8 = {{0, 7 b, b}, {0, -b, -7 b}, {\[Pi], -3 b, -5 b}, {\[Pi], 5 b,
3 b}};
R = DelaunayMesh[
Partition[Flatten[{p1, p2, p3, p4, p5, p6, p7, p8}], 3]];


I tried with the following

Show[Graphics3D[{Purple, Opacity[0.2],
Polygon[{p1, p2, p3, p4, p5, p6, p7, p8}]}, Opacity[0.4]], con]


which does not work. Can anyone kindly help me in this regard? Thanks in advance.

• Graphics3D[{{Purple, Opacity[0.2], Polygon[{p1, p2, p3, p4, p5, p6, p7, p8}]}, Opacity[0.4], con // First}] Jun 2 at 2:51
• Thanks for your respose. But wish to get the plot only inside the region R. Can you please help me to get that? Jun 2 at 3:01

RegionFunction -> Function[{x, y, z}, {x, y, z} ∈ R]


Or

RegionFunction -> Function[{x, y, z}, RegionMember[R, {x, y, z}]]

Clear[con];
con = ContourPlot3D[
Sin[x] Sin[y] + Sin[z] Sin[y] + Sin[x] Sin[z] + 1 ==
0.000001, {x, -2 π, 2 π}, {y, -2 π,
2 π}, {z, -2 π, 2 π},
RegionFunction -> Function[{x, y, z}, {x, y, z} ∈ R],
RegionBoundaryStyle -> None, BoundaryStyle -> None];
Graphics3D[{{Purple, Opacity[0.2],
Polygon[{p1, p2, p3, p4, p5, p6, p7, p8}]}, Opacity[0.4],
con // First}]


• When we rewrite the equation to Sin[x] Sin[y] + Sin[z] Sin[y] + Sin[x] Sin[z] + .9 == 0.000001, we can see the surface.

• Thanks a lot for your solution. This works very well. Is it possible to removes the black lines from the boundaries of the poligon surfaces ? I want just to keep the contour which satiesfies Sin[x] Sin[y] + Sin[z] Sin[y] + Sin[x] Sin[z] + 1 == 0.000001. Jun 2 at 3:42
• @atanu BoundaryStyle -> None. Jun 2 at 4:43
• Thanks for the help Jun 2 at 4:45