3

I am making a complex 3D image; part of it is a Cuboid, another part is a DensityPlot3D:

Show[{
  Graphics3D[{{Opacity[0.5], FaceForm[Opacity[0.5]], 
     Cuboid[{-1, -1, 0}, {1, 1, 1}]}}, Boxed -> False],
  Graphics3D[{FaceForm[Directive[Blue]], Opacity[0.5], 
    Prism[{{-1, -0.1, 0}, {-1, 0.1, 0}, {0, 0, 0}, {-1, -0.1, 1}, {-1,
        0.1, 1}, {0, 0, 1}}]}],
  DensityPlot3D[
   Exp[-6 r^2 + 1.5 Sqrt[r]*Cos[θ/2]]*
     Exp[-15 (z - 0.5)^2] /. {r -> Sqrt[x^2 + y^2], θ -> 
      ArcTan[x + 0.001, y]}, {x, -1, 1}, {y, -1, 1}, {z, 0, 1}, 
   ColorFunction -> (If[# > 0, Red, Green] &)]

  }]

which looks like what follows:

my figure

As you see, the front face of the cuboid contains some dirt, some sort of a parasitic dashing. If I remove the DensityPlot3D, this dirt disappears:

Show[{
  Graphics3D[{{Opacity[0.5], Cuboid[{-1, -1, 0}, {1, 1, 1}]}}, 
   Boxed -> False],
  Graphics3D[{FaceForm[Directive[Blue]], Opacity[0.5], 
    Prism[{{-1, -0.1, 0}, {-1, 0.1, 0}, {0, 0, 0}, {-1, -0.1, 1}, {-1,
        0.1, 1}, {0, 0, 1}}]}]
  }]

better image

and we see a clear face. Thus, it is due to the DensityPlot3D that I get the parasitic image part.

Any idea on how to remove it?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96

1 Answers1

7

Add

, Method -> {"RelieveDPZFighting" -> True}

to Show[].

enter image description here

Feyre
  • 8,597
  • 2
  • 27
  • 46