Do you know how to programm Shepard-Metzler-figures with R? I would interested in a step-by-step guide on how write the code. As you can see on the picture, these figures consist of ten cubes formed into a snake-like structure. Thank you so much for your help!

I am not used to R, so writing the code for those figures is quite hard.
You can use the {rgl} package. Here is a simple code:
Check the package help for much more info on how to make the figures neater.