I wrote the following to draw a pyramid, this approach uses functions TranslationTransform
and Tuples
, is there a way to do the same thing more concise? Maybe Table
, Nest
, ArrayPad
is useful.
cubes = {
{c1 = Cuboid[]},
TranslationTransform[{##, -1}][c1] & @@@ Tuples[{-1, 1}/2, 2],
TranslationTransform[{##, -2}][c1] & @@@ Tuples[{-1, 0, 1}, 2],
TranslationTransform[{##, -3}][c1] & @@@ Tuples[{-3, -1, 1, 3}/2, 2],
TranslationTransform[{##, -4}][c1] & @@@ Tuples[{-2, -1, 0, 1, 2}, 2]
};
Graphics3D[cubes]
Thank you all.