3
$\begingroup$

I'm trying to put this solid

Surface1

S1 = RegionPlot3D[z - 50 <= -2 x^2 - 2 y^2, {x, -5, 5}, {y, -5, 5}, {z, 0, 50}]

on top of this one

Surface2

S2 = 
  RegionPlot3D[x^2 + y^2 <= 50 , {x, -10, 10}, {y, -10, 10}, {z, -50, 0}, 
    PlotStyle -> RGBColor[0.15, 0.17, 0], Mesh -> None]

and it's just kind of smashing it into this

Show[
  RegionPlot3D[
    z <= -2 x^2 - 2 y^2 && z <= 8 x + y - 20, 
    {x, -10, 10}, {y, -10, 10}, {z, -100, 0}], 
  RegionPlot3D[x^2 + y^2 <= 50 , {x, -10, 10}, {y, -10, 10}, {z, -500, -100}, 
    PlotStyle -> RGBColor[0.15, 0.17, 0], Mesh -> None]]

Smashed Surface

How to combine these 3D plots correctly?

$\endgroup$
3
$\begingroup$

Try this

With[{color = RGBColor[0.95, 0.93, 0]},
  Show[
    RegionPlot3D[
      z <= -2 x^2 - 2 y^2 && z <= 8 x + y - 20, 
      {x, -10, 10}, {y, -10, 10}, {z, -100, 0}, 
      PlotStyle -> color, Mesh -> None],
    RegionPlot3D[
      x^2 + y^2 <= 50, 
      {x, -10, 10}, {y, -10, 10}, {z, -500, -100}, 
      PlotStyle -> color, Mesh -> None], 
    PlotRange -> All]]

solid

Your problem was mainly not giving the option PlotRange -> All to Show. Without that, you were only getting the range for first RegionPlot3D.

I changed the coloring only to get a better looking plot for this post. It not a part of your problem. You can choose any color you like.

$\endgroup$
2
$\begingroup$

Another way can be defining a single function

f[x_, y_, z_] := If[z > 0, z - 50 <= -2 x^2 - 2 y^2, x^2 + y^2 <= 50]
RegionPlot3D[f[x, y, z], {x, -10, 10}, {y, -10, 10}, {z, -50, 50}]

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.