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);
5 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…

9 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…

3 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)

9 Likes

hehe @chuongmep …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)

3 Likes

Hi @vanquyet9494 The forum is in english,please translate before upload…

1 Like

The piramide was the easy part, the decorations not so much, what I did was:

  1. List of insertion points.
  2. Take the first 2 and insert a plane and a rectangle in each one, the upper one smaller than the lower one.
  3. Make a solid by loft between these 2 rectangles.
  4. Scale this solid 9 times in equal proportions.
  5. Insert each instance in the list of insertion points.
    I hope it helps.
5 Likes

interesting can you complete the design and mirror the pyramid to have one pointing downwards.