I adjusted the algorithm a little bit, and here is a possible sand cube:
And of course, we need floors too:
Progression seems smooth enough but I'm curious how it will work in game.
Here is the first interface element, a stockpile marker:
The algorithm is not that good yet, because it messes up with at least the color red: