Monday 12 February 2018

Nssa

Nssa means "a type of hand woven fabric". It is the symbol of symbol of excellence, genuineness, authenticity.

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


This symbol is simple to draw. It consists of lines.

The plan to draw this symbol is given below:

  1. Lift up the pen
  2. Set the pen size to 20 pixels
  3. Set the heading of the pen to 0 degrees
  4. Move the pen back by 70 pixels
  5. Place the pen down
  6. Move forward by 140 pixels
  7. Move the pen back to the home position
  8. Set the heading of the pen to 90 degrees
  9. Move the pen back by 60 pixels
  10. Move forward by 120 pixels
  11. Set the heading of the pen to 180 degrees
  12. Move forward by 60 pixels
  13. Set the heading to 90 degrees
  14. Move forward by 90 pixels
  15. Set the heading of the pen to 180 degrees
  16. Move forward by 120 pixels
  17. Set the heading of the pen to 270 degrees
  18. Move forward by 120 pixels
  19. Set the heading of the pen to 0 degrees
  20. Move forward by 100 pixels
  21. Set the heading of the pen to 270 degrees
  22. Move forward by 60 pixels
  23. Set the heading of the pen to 180 degrees
  24. Move forward by 100 pixels
  25. Set the heading of the pen to 270 degrees
  26. Move forward by 120 pixels
  27. Set the heading of the pen to 0 degrees
  28. Move forward by 120 pixels
  29. Set the heading of the pen to 90 degrees
  30. Move forward by 90 pixels
  31. Set the heading of the pen to 0 degrees
  32. Move forward by 120 pixels
  33. Set the heading of the pen to 270 degrees
  34. Move forward by 90 pixels
  35. Set the heading of the pen to 0 degrees
  36. Move forward by 120 pixels
  37. Set the heading of the pen to 90 degrees
  38. Move forward by 120 pixels
  39. Set the heading of the pen to 180 degrees
  40. Move forward by 100 pixels
  41. Set the heading of the pen to 90 degrees
  42. Move forward by 60 pixels
  43. Set the heading of the pen to 0 degrees
  44. Move forward by 100 pixels
  45. Set the heading of the pen to 90 degrees
  46. Move forward by 120 pixels
  47. Set the heading of the pen to 180 degrees
  48. Move forward by 120 pixels
  49. Set the heading of the pen to 270 degrees
  50. Move forward by 90 pixels
  51. Set the heading of the pen to 180 degrees
  52. Move forward by 60 pixels
Using Turtle Graphics

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

The code for steps 1 to 10 is given below:

turtle.penup()
turtle.pensize(20)
turtle.setheading(0)
turtle.backward(70)
turtle.pendown()
turtle.forward(140)
turtle.home()
turtle.setheading(90)
turtle.backward(60)
turtle.forward(120)

The image generated is given below:



The code for steps 11 to 22 draws the outline of the shape for the upper left quadrant and extends to the lower left quadrant. The code for the steps is:

turtle.setheading(180)
turtle.forward(60)
turtle.setheading(90)
turtle.forward(90)
turtle.setheading(180)
turtle.forward(120)
turtle.setheading(270)
turtle.forward(120)
turtle.setheading(0)
turtle.forward(100)
turtle.setheading(270)
turtle.forward(60)

The generated image is shown below:


The remaining steps are just a repetition of the steps we have executed so far. The code for steps 23 to 32 gives us the image shown below:


Steps 33 to 42. draw the 3rd square. The code for this steps is given below:

turtle.setheading(270)
turtle.forward(90)
turtle.setheading(0)
turtle.forward(120)
turtle.setheading(90)
turtle.forward(120)
turtle.setheading(180)
turtle.forward(100)
turtle.setheading(90)
turtle.forward(60)

The generated image is shown below:


The code to complete the symbol is given below:

turtle.setheading(0)
turtle.forward(100)
turtle.setheading(90)
turtle.forward(120)
turtle.setheading(180)
turtle.forward(120)
turtle.setheading(270)
turtle.forward(90)
turtle.setheading(180)
turtle.forward(60)

The final symbol is given below:


Conclusion

Nssa is one of the easier symbols to draw although the steps are involved. Its kind of fun to see the turtle go about drawing this shape.

No comments:

Post a Comment