1
$\begingroup$

I have a RegionPlot3D:

RegionPlot3D[
 Sin[1.5 (x - y)/Sqrt[2]]^2*Exp[-(z^2 + ((x + y)/Sqrt[2])^2)/2/20]  + 
   Sin[1.5 (x + y)/Sqrt[2]]^2*
    Exp[-(z^2 + ((x - y)/Sqrt[2])^2)/2/20] + 
   Sin[1.5 x]^2*Exp[-(z^2 + y^2)/2/20] + 
   Sin[1.5 y]^2*Exp[-(z^2 + x^2)/2/20] > 0.6, {x, -20, 20}, {y, -20, 
  20}, {z, -20, 20}, PlotPoints -> 100, 
 PlotStyle -> Directive[Orange, Specularity[White, 40]], Mesh -> None,
  Boxed -> False, Axes -> False]

I want to add bounds to the plot so as to only plot the result within some radius, so as not to get the cut-out circles at the corners:

plot

$\endgroup$
  • $\begingroup$ So why not tack on && x^2 + y^2 <= r^2 to your inequality being plotted? $\endgroup$ – J. M. will be back soon Oct 13 '18 at 14:22
1
$\begingroup$
f[x_, y_, z_]:= And[x^2 + y^2 + z^2 <= 300, 
  Sin[1.5 (x - y)/Sqrt[2]]^2*Exp[-(z^2 + ((x + y)/Sqrt[2])^2)/2/20] + 
   Sin[1.5 (x + y)/Sqrt[2]]^2*Exp[-(z^2 + ((x - y)/Sqrt[2])^2)/2/20] +
    Sin[1.5 x]^2*Exp[-(z^2 + y^2)/2/20] + Sin[1.5 y]^2*Exp[-(z^2 + x^2)/2/20]>.6]

RegionPlot3D[f[x, y, z], {x, -20, 20}, {y, -20, 20}, {z, -20, 20}, 
  PlotPoints -> 50, PlotStyle -> Directive[Orange, Specularity[White, 40]], Mesh -> None,
  Boxed -> False, Axes -> False]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.