Hi, I am currently working on a numerical simulation of the flow of two fluids through porous digital rocks using C++. I have a binary file(1=rock,0=void) for the rock which has a 2D slice-based structure meaning that the data representing 10x10x10 rock will have 10 columns and 100 rows with every ten rows representing a slice of a 3D structure. And also the data on a separate file with the same structure representing the position of the fluid in the voids(0's) of that rock. I have already stacked the 2D array to 3D using python but I don't know how to plot this as voxels to visualize the 3D rock and the fluid inside of it. I tried 3D voxel plots using matplotlib but it turned to be so slow for a large chunk of data(1000x1000x1000). It does not seem to be a tough challenge, however, I cannot find a proper way to do it. All I want is a 3D voxel plot with some transparency adjustments which is not very slow. For example, I'd like to plot a 3D binary array with 0's as void and 1's as solid and then on that figure the fluid with 0's as no fluid and 1's as fluid(similar to " hold on" functionality in matlab). It would be even nicer to give colors corresponding to the density of the fluid at each voxel since I have a array with float values as well. The file format which I write out from the simulation is just simple .dat format with containing space-separated float(or binary) values. Then from that file I just read the values as a 3D array using python. Below is a nice example of what I want to do.
https://ibb.co/RN7qQwn