16

Bug introduced in V10.4 and fixed in 10.4.1


Suppose we have the following array from which we intend to create an ArrayMesh:

arr = {{{1, 1, 1}, {1, 0, 1}, {1, 1, 0}}, {{1, 1, 1}, {0, 1, 1}, {1, 1, 
   0}}, {{0, 1, 0}, {0, 1, 1}, {0, 0, 1}}};

If we create the ArrayMesh and use one of the styling Options in this case MeshCellStyle, the color is not evenly applied:

ArrayMesh[arr, MeshCellStyle -> {{2, All} -> Yellow}]

Mathematica graphics

And as you manipulate this mesh object it flickers like crazy:

enter image description here

This does not happen if you use HighlightMesh to style it:

HighlightMesh[ArrayMesh[arr], {Style[2, Yellow]}]

Mathematica graphics.

Can anyone reproduce this behavior. Note that ArrayMesh is new in 10.4. I'm using Windows 10 64bit

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
RunnyKine
  • 33,088
  • 3
  • 109
  • 176

1 Answers1

12

This is an artifact in Graphics3D rendering (Z-fighting) which is generally difficult to avoid when using a depth buffer.

While ArrayMesh is new in 10.4, you would see similar behavior if you did copy and paste the result into an older version.

As a possible workaround, try

SetOptions[$FrontEnd, 
   RenderingOptions -> {"Graphics3DRenderingEngine" -> "BSPTree"}]
ilian
  • 25,474
  • 4
  • 117
  • 186