Sorry to come back to an old post. I was reviewing this discussion: Stacked 3D Pyramid And trying to work on Guilherme's answer, where he adds shading. Following on this, I was trying to do something similar but dividing the three parts of the pyramid according to their share in the total volume. For example: that the first part corresponds to 60%, that the middle part corresponds to 30% and that the top of the pyramid represents 10% of the volume of the complete pyramid. While I understand that this would require modifying some height-related commands, it has been difficult for me to modify the code to obtain an appropriate result. I would appreciate any comments. Thank you in advance to anyone who masters tikz. Best of luck.
Asked
Active
Viewed 45 times
\coordinate (\n\level b) at ($(\n)!\lastlevel/\levels+\levelsep/2!(H)$);}}to define the coordinates for each level. He used aforeachloop for that. You have to modify it to have it define the coordinates lower proportionally to the values you specified (60,30,10%) – anis Mar 01 '24 at 15:16