Tinkercad - Codeblocks: Pyramids

825

2

4

Introduction: Tinkercad - Codeblocks: Pyramids

In this indestructible i want to do something special with use of Codeblocks by Tinkercad. This amazing web 3d creating tool is good, but Codeblocks to this day have insufficient options to full programming like Scratch. However this features already allow to create super things - in 3d!

Honestly it was my first meeting with Tinkercad: Codeblocks, but with experience from Scratch it was a piece of cake.

History:

Returning to Pyramids in Egypt...

...did you know that Pyramids was smooth and white above golds of sand?

Also its probably that pyramids was build by free men. Many of time took construction of a road from Nile to Pyramids.

Fun fact 3:

Great Pyramid of Giza is the oldest of The Seven Wonders of the Ancient World

Apologies:

Sorry for Polish language in blocks, Tinkercad after crating a file its language is constant despite language changing in the menu.

I translated for you variables and comments to follow what is happening in code.

Supplies

  • Tinkercad: Codeblocks
  • "codeblocks" form programming skills
  • A bit of creativity

Step 1: Creating the Primary Block

In this step i created a block with its dimensions used all the time. Also i moved it by half its height to relocate it above the surface(axis z= 0). Except a block i created basic variables too.

Use of variables allows to change block size and pyramid size by only changing the width value. The ratio(1:2) of sides(collected from Lego 4x2 block :D) helped me to construct this pyramid by use of 4 blocks and turn formula.

Step 2: Walls

With next organisational unit i added new variables witch allow to control a block placement and its amount.

Primary form of this project is block and its the most important dimension: width, so distance of block placement is mean in width.

"The Universe is wide"

- Me the scream

With each new wall the form of wall script was changing, so I'm placing here all changed wall script formula^.

Step 3: Complement

Second wall

After creating walls they should be copied and rotated by 90° - construction of wall_90 up^

//wall_90 - I mean wall rotated by 90 degrees

In many cases here I didn't use exactly the same form of code for each 90 wall.

It depends on a level:

  1. In uneven number of level, there are 4(at first level) blocks and block rotated by 90° in line.
  2. In even numbers block rotated by 90° is behind 4th(depends on level) block.

In the next to last level there are only block and identical, but rotated(90°) and(of course corner). - up^

Corner

Corner is a wall and wall_90 collected in group(new colour) and rotated by 90°.

At the final level there is only block and parallel to it its copy. - up^

I must to say that corner was the easiest part of coding, but - at the beginning - that didn't was short like now - remember compression in coding is very important. For curious people it was exactly the like wall and wall_90 script gum together.


Step 4: Naturalistic

The last step is about a cut. It's cuboid rotated 60° and made invisible(I mean cut).

This cut is for making my project naturalistic, because Pyramids construction block had a cover blocks from white polished limestone(first step - History). I don't want in order that my pyramid be white, so i cut it, but colours are for educational feature and perfectly shows construction.


Step 5: The End

All the code I'm placing up^ and in Tinkercad link

I think that you had a great experience.

Than you and wait for more instructables.

-MJ

Block Code Contest

Participated in the
Block Code Contest

Be the First to Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Furniture Contest

      Furniture Contest
    • Home Decor Challenge

      Home Decor Challenge

    4 Comments

    0
    Josiah Miller
    Josiah Miller

    5 months ago

    pretty nice! :)

    0
    mateyou
    mateyou

    Reply 5 months ago

    thanks!

    0
    StumpChunkman
    StumpChunkman

    5 months ago

    This is really cool. I like the one flat side, and the use of Lego's to demonstrate what Tinkercad is doing. 2 comments:
    - Did you know that Tinkercad Codeblocks can export a .gif animation of your build?
    - If you don't mind, it would be great if you could make your project public and share the link. It would make it much easier to go through all the code.
    Again, awesome job!