Monday 19 February 2018

Nyansapo


Nyansapo means "wisdom knot". It is the symbol of wisdom, ingenuity, intelligence and patience.

We will use the 5 pixel grid to trace out this image. The image of this is shown below:


This symbol is easy to draw. The plan to draw this shape is shown below:

  1. Lift up the pen
  2. Move the turtle to the position (0, -35)
  3. Set the pen size to 10 pixels
  4. Draw a circle of radius 80 pixels
  5. Lift up the pen
  6. Move the turtle to the position (0, -125)
  7. Place the pen down
  8. Draw a circle of radius 80 pixels
  9. Lift up the pen
  10. Move the turtle to the position (-25, -185)
  11. Set the heading to 90 degrees
  12. Place the pen down
  13. Move forward by 150 pixels
  14. Repeat steps 9 to 13 but change the position of step 10 to (25, -185)
  15. Lift up the pen
  16. Move the turtle to the position (-25, 185)
  17. Set the heading to 270 degrees
  18. Place the pen down
  19. Move forward by 150
  20. Repeat steps 15 to 19 but change the position of step 16 to (25, 185)
  21. Lift up the pen
  22. Move the turtle back to its home position
  23. Change its colour to white
  24. Set its heading to 270 degrees
  25. Change its pen size to 40
  26. Place the pen down
  27. Move backward by 40 pixels
  28. Move forward by 80 pixels

Using Turtle Graphics

We will use the template.py file and rename it to nyansapo.py.

The code for the first four steps is given below:

turtle.penup()
turtle.setposition(0, -35)
turtle.pensize(10)
turtle.pendown()
turtle.circle(80)

The generated image is shown below:


The code for steps 5 to 8 is given below:

turtle.penup()
turtle.setposition(0, -125)
turtle.pendown()
turtle.circle(80)

The generated image is given below:


The code for steps, 9 to 13 is given below:

turtle.penup()
turtle.setposition(-25, -185)
turtle.setheading(90)
turtle.pendown()
turtle.forward(150)

The code for step 14 is given below:

turtle.penup()
turtle.setposition(25, -185)
turtle.setheading(90)
turtle.pendown()
turtle.forward(150)

The generated image is shown below:


The code for steps 15 to 19 is given below:

turtle.penup()
turtle.setposition(25, 185)
turtle.setheading(270)
turtle.pendown()
turtle.forward(150)

The code for step 20 is given below:

turtle.penup()
turtle.setposition(-25, 185)
turtle.setheading(270)
turtle.pendown()
turtle.forward(150)

The generated image is shown below:


The code for steps 21 to 28 is given below:

turtle.penup()
turtle.home()
turtle.color(“white”, “white”)
turtle.setheading(270)
turtle.pensize(40)
turtle.pendown()
turtle.backward(40)
turtle.forward(80)

The generated image is shown below:


Conclusion

We have succeeded in drawing the symbol Nyansapo. It wasn't so difficult to draw.

No comments:

Post a Comment