Build a pyramid with cubes

Hello, I would like to build a pyramid with cubes, i imagined to start with points, copy them in direction of Z axis, and than generate cubes. But the problem is, when i copy points on the next level, i dont want to have points that are on the outer edge, to resemble the pyramid shape which gets narrower to the top. how can i solve this issue ? Thank youu :slight_smile:

Welcome @s4lomep
There could be alternate solutions using nodes, but let me respond your first post with a one liner

n = 0..25;
Cuboid.ByLengths(Point.ByCoordinates((-n..n)<1><1>,(-n..n)<1><2>,List.Reverse(n)<1>),1,1,1);
4 Likes

Thank you a lot for help, I am new to dynamo and for me it’s a bit hard to understand, to look at only at the script, can you specify which nodes I could use ?

The only corresponding nodes to the Design Script code I’ve shared are Sequence, Point.ByCoordinates, Cuboid.ByLengths
While I haven’t tried it myself, it might not be possible to get the desired result by just manipulating lacing and levels on these nodes.
If this is a learning exercise you could start by creating a grid of points and then figure out ways to Take/Drop items as required.

1 Like

Hello @s4lomep …here is a way with nodes, not so good as @Vikram_Subbaiah amazing solution…but could probably work…

7 Likes

yeah, that’s what i thought to do seemed complcated :nerd_face: Thank you !

Thanks a lot ! I’ll try it out

1 Like

Yes can be done many ways…

2 Likes

A square pyramid is described by five points E0, E1, E2, E3, E4. eg E0= [0,0,1];E1= [1,1,0]; E2= [-1,1,0]; E3= [-1,-1,0]; E4= [1,-1,0]
image
a little mischievous in my spare time
uZGDi2yZif

Pyramid.dyn (42.7 KB)

7 Likes

hehe @chuongpqvn …thats a great way :wink:

1 Like

i had script of the great pyramid and created revit elements a while back.
scale the pyramid to feet or meters. 210 levels, I was trying to layout the size of the space ship in the new secret chamber.

0 - Earth.dyn (1.8 MB)

2 Likes