I'd like to use your code for the creation of a volume from an isosurface defined by the vertices and the faces as used by patch. However, the VOXELISE method does not return the expected results. I have created a simple example in order to reproduce the problem:
Am I doing something wrong or is this a bug in the code?
I believe I have found out how to reproduce the problem. If I use 'painters' (default) as figure renderer the problem does not occur. However, when using opengl rendering the above mentionend problem happens.
To reproduce, execute set(0,'DefaultFigureRenderer','OpenGL') before running my example code (text() makes no difference)
Unfortunately, 'painters' is no option for me as I am doing more advanced 3d rendering.
I have messed a bit with drawnow. The simple example I have given is fine by using drawnow. However, if you additionally use the text function in the plot it is not working correctly. Maybe you can reproduce the issue on your system: