4
$\begingroup$

I have some complicated 3D plots that rendered fine in Mathematica 11. With Mathematica 12, however, objects are not drawn in the right order and objects that should be hidden appear in front. This can be seen in the following simplified example:

Show[
 Graphics3D[{FaceForm[Yellow], 
   Polygon[{{-1, -1, 0}, {-1, 1, 0}, {1, 1, 0}, {1, -1, 0}}]}],
 Graphics3D[{Thick, Black, Line[{{-1, 0, -0.1}, {1, 0, -0.1}}]}],
 PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}},
 ViewPoint -> {1.6, -1.7, 2.45},
 ViewVertical -> {-0.12, 0.13, 0.98}
 ]

Example

Since this may be macOS specific (or even Mojave 10.14.5 specific) let me describe what is wrong: the black line is only partly hidden by the yellow polygon and it actually appears to go through the polygon. The viewpoint is important. With other viewpoints objects are rendered correctly.

This is clearly a rendering bug. Is there any idea on how to work around this bug in a reliable way?

$\endgroup$
5
  • 3
    $\begingroup$ Please include a screenshot. I do not see the problem with M12.0.0 on macOS 10.14.6 with Radeon Pro 560 GPU. $\endgroup$
    – Szabolcs
    Jul 24 '19 at 14:52
  • $\begingroup$ Thanks! Screenshot added. $\endgroup$
    – cefstat
    Jul 24 '19 at 15:02
  • $\begingroup$ I can't reproduce this on my Mac. Please send this to support@wolfram.com, including the input, the screenshot, the result of evaluating SystemInformation[], and information about your computer (model, OS version, graphics card, etc...) $\endgroup$ Jul 24 '19 at 15:32
  • $\begingroup$ Confirm it in version 12.0 on Windows 10 32-bit. $\endgroup$
    – user64494
    Jul 24 '19 at 16:20
  • $\begingroup$ Confirm it in v12.0.0 on MacOS 10.12.6 $\endgroup$
    – Shadowray
    Jul 24 '19 at 20:53
2
$\begingroup$

I was able to reproduce the image on Windows V12. Replacing Line with Tube appears to help this case.

{Show[Graphics3D[{FaceForm[Yellow], 
    DiscretizeGraphics@
     Polygon[{{-1, -1, 0}, {-1, 1, 0}, {1, 1, 0}, {1, -1, 0}}]}], 
  Graphics3D[{Thick, Black, Line[{{-1, 0, -0.1}, {1, 0, -0.1}}]}], 
  PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, 
  ViewPoint -> {1.6, -1.7, 2.45}, 
  ViewVertical -> {-0.12, 0.13, 0.98}], 
 Show[Graphics3D[{FaceForm[Yellow], 
    DiscretizeGraphics@
     Polygon[{{-1, -1, 0}, {-1, 1, 0}, {1, 1, 0}, {1, -1, 0}}]}], 
  Graphics3D[{Thick, Black, Tube[{{-1, 0, -0.1}, {1, 0, -0.1}}]}], 
  PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, 
  ViewPoint -> {1.6, -1.7, 2.45}, 
  ViewVertical -> {-0.12, 0.13, 0.98}]}

Line vs Tube

$\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.