Thursday, 2 November 2017

Hwemudua


Hwemudua means "measuring stick". It is the symbol of examination and quality control. This symbol stresses the need to strive for the best quality, whether in production of goods or in human endeavors.

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


This shape is easy to draw. It consists only of straight lines. This lines are horizontal and vertical.

The width of the blocks is taken to be 4 squares. With this information, we can draw the entire shape. We will draw the horizontal lines first.

The plan to draw this shape is given below:

  1. Lift the turtle
  2. Set the pen size to 40 pixels
  3. Move the turtle to the position that is (-160. -170)
  4. Place the pen down
  5. Move the turtle forward by 320 pixels
  6. Lift up the pen
  7. Move the turtle to the position that is (-120. 170)
  8. Place the pen down
  9. Move the turtle forward by 240 pixels
  10. Lift up the pen
  11. Move the pen to the point that is (-170. -80)
  12. Set the heading of the pen to 90 degrees
  13. Place the pen down
  14. Move 130 pixels forward
  15. Set the heading of the pen to 0 degrees
  16. Move the turtle forward by 340 pixels
  17. Set the heading of the pen to 270 degrees
  18. Move 130 pixels forward
  19. Lift up the pen
  20. Move the pen to the position (-80, -170)
  21. Set the heading of the turtle to 90 degrees
  22. Place the pen down
  23. Move forward by 200 pixels
  24. Lift up the pen
  25. Move the pen to the position (-80, 0)
  26. Set the heading of the turtle to 90 degrees
  27. Place the pen down
  28. Move forward by 250 pixels
  29. Lift up the pen
  30. Move the pen to the position (80, -170)
  31. Set the heading of the turtle to 90 degrees
  32. Place the pen down
  33. Move forward by 200 pixels

Using Turtle Graphics

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

The code for steps 1 to 5 is shown below:

turtle.penup()
turtle.pensize(40)
turtle.setposition(-160, -170)
turtle.pendown()
turtle.forward(320)

The generated image is shown below:


The code for steps 6 to 9 are given below:

turtle.penup()
turtle.setposition(-160, 170)
turtle.pendown()
turtle.forward(240)

The generated image is shown below:


The next part of the symbol to be drawn is the upside down U shape. To draw it, we would need to first move the cursor to the point where (-170, -80).

The steps 10 to 18 are given in code as shown below:

turtle.penup()
turtle.setposition(-170, -80)
turtle.setheading(90)
turtle.pendown()
turtle.forward(130)
turtle.setheading(0)
turtle.forward(340)
turtle.setheading(270)
turtle.forward(130)

The generated image is shown below:


To complete this symbol, now all we have to do is draw the vertical lines. We start from the left of the shape.
The steps 19 to 23 are given in code shown below:

turtle.penup()
turtle.setposition(-80, -170)
turtle.setheading(90)
turtle.pendown()
turtle.forward(200)

The generated image is shown below:


The code for steps 24 to 28 is given below:

turtle.penup()
turtle.setposition(0, -80)
turtle.setheading(90)
turtle.pendown()
turtle.forward(250)

The generated image is shown below:


The code for the steps 29 to 33 is given below:

turtle.penup()
turtle.setposition(80, -170)
turtle.setheading(90)
turtle.pendown()
turtle.forward(200)

The generated image is shown below:


Conclusion

At the end of this section, we have successfully used Python turtle to draw the Hwemudua symbol.

This is one of the easiest symbol to draw because it is made up of lines.



No comments:

Post a Comment