Pattern Play in Tinkercad Codeblocks

by losc in Teachers > 4

4063 Views, 28 Favorites, 0 Comments

Pattern Play in Tinkercad Codeblocks

投影片31.jpg

What is pattern? Where do we see patterns? A pattern is something that repeats and repeats. And there are many types of patterns! In this instructable, we start with making some colour patterns and number patterns with coding - the Tinkercad Codeblocks! When making those patterns, you may have an optical illusion. No worries! Because you are also making illusion arts with patterns. Later, we will introduce a special number pattern which is considered to make your art works more perfect. Enjoy and have fun!

Remarks:

  1. Try to keep the code as short as possible
  2. The code example is for reference only

Supplies

suppliers.png

Make 5 Cubes in a Row

Rev-PatternPlay1-LineUp-1a.gif
STEP1a.jpg
STEP1b.jpg
投影片3.JPG

Look at the animation, and try to write the codes by using the following techniques:

  1. ADD and MOVE
  2. COPY and MOVE
  3. REPEAT LOOP

Please consider the following information in your programming:

  1. Make the cubes W=10, L=10, H=10
  2. The distance between cubes is 12

Make 6 Rows of 5 Cubes

Rev-PatternPlay2-Rows1.gif
投影片4.JPG
投影片5.JPG

Look at the animation, and try to write the codes by using the following techniques:

  1. REPEAT LOOP
  2. REPEAT LOOP and TEMPLATE

Please consider the following information in your programming:

  1. Make the cubes W=10, L=10, H=10
  2. The distance between cubes is 12

Make a Checked Pattern (style 1)

PatternPlay3-Colours1 (1).gif
投影片6.JPG
投影片7.JPG

Look at the animation, do you see the illusion? Dark dots seem to appear and disappear at intersections.

Try to write the codes by using the following techniques:

  1. REPEAT LOOP
  2. REPEAT LOOP and TEMPLATE

Please consider the following information in your programming:

  1. Make the squares W=10, L=10, H=1
  2. The distance between squares is 12

Make a Checked Pattern (Style 2)

Rev-PatternPlay3-Colours1c.gif
STEP4-STYLE2.png
STEP4-2a.jpg
STEP4-2b.jpg
STEP4-2c.jpg

Look at the animation, do you see the illusion? Dark dots seem to appear and disappear at intersections.

Try to write the codes by using the following techniques:

  1. REPEAT LOOP and TEMPLATE
  2. Make full grid with COUNT LOOP

Please consider the following information in your programming:

  1. Make the squares W=10, L=10, H=1
  2. The distance between squares is 12

Make a Number Tower (Style 1)

PatternPlay4-NumberTower1.gif
投影片10.JPG

What pattern do you see?

  • 1, 2, 3, 4 and 5
  • This is a number pattern
  • It is in ascending order
  • The difference between two numbers is 1!

Look at the animation, and try to write the codes by using the following techniques:

  • COUNT

Please consider the following information in your programming:

  1. The lengths (L) of the objects are 1, 2, 3, 4 and 5 respectively
  2. The width (W) and height (H) remain at 1

Make a Number Tower (Style 2)

PatternPlay4-NumberTower2.gif
投影片11.JPG

What pattern do you see?

  • This number pattern is similar to the previous one, but all objects are aligned in one end.

Look at the animation, and try to write the codes by using the following techniques:

  • COUNT

Please consider the following information in your programming:

  1. The length (L) of the objects should be 1, 2, 3, 4 and 5 respectively
  2. The width (W) and height (H) remain at 1
  3. All objects should be aligned in one end

Make an Even Number Tower

PatternPlay4-NumberTower3Even.gif
投影片12.JPG

What pattern do you see?

  • This number pattern is in ascending order
  • The difference between two numbers is 2
  • Those numbers can be divided by two
  • They are even numbers

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

  1. The length (L) of the objects should be 2, 4, 6, 8 and 10 respectively
  2. The width (W) and height (H) remain at 1
  3. Align one end of all objects

Make an Odd Number Tower

PatternPlay4-NumberTower4Odd.gif
投影片13.JPG

What pattern do you see?

  • This number pattern is in ascending order
  • The difference between two numbers is 2
  • Those numbers cannot be divided by two
  • They are odd numbers

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

  1. The length (L) of the objects should be 1, 3, 5, 7 and 9 respectively
  2. The width (W) and height (H) remain at 1
  3. Align one end of all objects

Make Any Stepped Tower

AnySteppedTower.jpg

Is there a way to create an "Any stepped tower" simply by changing the variables? Or, try modifying Step 7.

I'm looking forward to your insights and sharing.

Number Pattern - Fibonacci Numbers

copy of Fibonacci Number (1).gif
投影片29.jpg

0, 1, 1, 2, 3, 5, 8, 13, 21... What pattern do you see?

This is a special pattern and it is considered to have a golden ratio and a mystical relationship with nature. Maybe you have seen it in daily life. Do you have any idea what this number pattern is?

This number pattern is called Fibonacci numbers. In this sequence, the next number is the addition of two previous numbers (except the first and second number). For example, by adding 3 and 5, we get the seventh number as 8. In the following activities, the Fibonacci numbers will be applied to the programming to make your unique art works. And let the hidden Fibonacci pattern make your art works awesome!

The above animation shows the drawing of Fibonacci Rectangles, and it is said to be the most beautiful rectangle. This rectangle consists of several squares, in which the square's sides follow the Fibonacci numbers.

Make a Tower With Fibonacci Numbers

Fibonacci Tower.gif
投影片15.JPG

What pattern do you see?

  • The tower's length follows the pattern of Fibonacci numbers

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

  1. The length (L) of the objects should be 1, 2, 3, 5, 8, 13, 21 and 34 respectively
  2. The width (W) and height (H) remain at 1
  3. Align one end of all objects
  4. Make use of variables and loops to reduce redundant code

Make a Sphere With Fibonacci Numbers

Fibonacci calculation - ball.gif
STEP12.jpg

What pattern do you see?

  • The sphere's radius follows the pattern of Fibonacci numbers

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

  1. The radius of the objects should be 1, 2, 3, 5, 8 and 13 respectively
  2. Make use of variables and loops to reduce redundant code

Fibonacci Numbers in Nature

Fibonacci - Sunflower Petals.gif
STEP13.jpg

The number of sunflower petals is a Fibonacci number. The next petal rotates around 137.5° or 222.5°. This rotation also follows the Fibonacci numbers, and we can make use of the ratio to create some unique art works (in step 13 to 15). Here, all examples use 140° as the rotation degree.

The rotation ratio of sunflower petals:

222.492°137.508° = 1.618...

Example 1: Name Tag

Fibonacci calculation - star.gif
投影片30.jpg

Is there any pattern in this name tag? What are the hidden Fibonacci sequences?

  • Fibonacci Rectangle
  • Stars (size and rotation)

Code example (Please click here)

Example 2: Badge

投影片24.JPG
投影片25.JPG

Is there any pattern in this badge? What are the hidden Fibonacci sequences?

  • Stars' size (Fibonacci sequence)
  • Stars' rotation (Number pattern)

Code example (Please click here)

Example 3: Pocket Mirror

投影片26.JPG
投影片27.JPG

Is there any pattern in this pocket mirror? What are the hidden Fibonacci sequences?

  • Stars' size (Fibonacci sequence)
  • Rotation of stars, circles and hearts (Number pattern)

Code example (Please click here)

More Examples

投影片19.JPG
投影片32.jpg

Here are some examples. Make Your own art works with patterns. Have fun!