Friday 2 February 2018

Nea Onnim No Sua A Ohu


Nea Onnim No Sua A Ohu means "He who does not know can know from learning". It is the symbol of knowledge, life-long education and continued quest for knowledge.

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


This shape is simple. It consists of lines. We simply have to get the coordinates from which we will be drawing the lines from.

The plan to draw the shape is shown below:

  1. Lift up the pen
  2. Set the pen size to 30
  3. Draw the vertical center lines
  4. Set the pen size to 20
  5. Draw the 3 horizontal center lines
  6. Draw all the vertical lines
  7. Draw all the horizontal lines
Using Turtle Graphics


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

The code for steps 1 and 2 are given below:

turtle.penup()
turtle.pensize(40)

To draw the first vertical line, we need to move the pen to the position (0, 50), set the heading of the turtle to 90 degrees, place the pen down and move it to the position (0, 160) by moving forward by 110 pixels. The code to do this is shown below:

turtle.setposition(0, 50)
turtle.setheading(90)
turtle.pendown()
turtle.forward(110)

The generated image is shown below:


To draw the second vertical line, we need to move the pen to the position (0, -40), set the heading of the turtle to 270 degrees, place the pen down and move it to the position (0, -160) by moving forward by 120 pixels. The code to do this is shown below:

turtle.penup()
turtle.setposition(0, -50)
turtle.setheading(270)
turtle.pendown()
turtle.forward(110)

The generated image is shown below:


To set the pen size to 20 we use the code shown below:

turtle.pensize(20)

To draw the three horizontal center lines, We need to move the mouse to the positions of the shape and move forward by 140 pixels. The position of the lines are at (-70, 40), (-70, 0) and (-70, -40). The code that does this is shown below:

turtle.penup()
turtle.setposition(-70, 40)
turtle.setheading(0)
turtle.pendown()
turtle.forward(140)
turtle.penup()
turtle.setposition(-70, 0)
turtle.setheading(0)
turtle.pendown()
turtle.forward(140)
turtle.penup()
turtle.setposition(-70, -40)
turtle.setheading(0)
turtle.pendown()
turtle.forward(140)

The generated image is shown below:


We need to draw the six vertical lines as scaffolding for the symbol. The way to draw this would be to get to the upper part of the vertical lines and draw the line down.

The first two lines have the same length while the third line is the longest. The fourth line is the same length as the third line while the last 2 lines have the same length as the first two.

To draw these vertical lines, we need to lift the pen up and set its heading to 270 degrees. Then we can start drawing the vertical lines. The code to do this is shown below:

turtle.penup()
turtle.setheading(270)
turtle.setposition(-170, 80)
turtle.pendown()
turtle.forward(160)
turtle.penup()
turtle.setposition(-120, 80)
turtle.pendown()
turtle.forward(160)
turtle.penup()
turtle.setposition(-70, 180)
turtle.pendown()
turtle.forward(360)
turtle.penup()
turtle.setposition(170, 80)
turtle.pendown()
turtle.forward(160)
turtle.penup()
turtle.setposition(120, 80)
turtle.pendown()
turtle.forward(160)
turtle.penup()
turtle.setposition(70, 180)
turtle.pendown()
turtle.forward(360)

The generated image is shown below:


The horizontal lines on the left are going to be drawn from the first to the last. The first and the last are longer than the others.

To draw the horizontal lines, we have to move the turtle and set its heading to 180 degrees. From there, we draw to the left of the shape. We draw the lines along the longest line. The code to do this is shown below:

turtle.penup()
turtle.setheading(180)
turtle.setposition(-70, 180)
turtle.pendown()
turtle.forward(110)
turtle.penup()
turtle.setposition(-70, 130)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(-70, 80)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(-70, -80)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(-70, -130)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(-70, -180)
turtle.pendown()
turtle.forward(110)
turtle.penup()
turtle.setheading(0)
turtle.setposition(70, 180)
turtle.pendown()
turtle.forward(110)
turtle.penup()
turtle.setposition(70, 130)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(70, 80)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(70, -80)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(70, -130)
turtle.pendown()
turtle.forward(100)
turtle.penup()
turtle.setposition(70, -180)
turtle.pendown()
turtle.forward(110)

The generated image is shown below:


Conclusion

At the end of this section, we have successfully drawn the Nea Onnim No Sua A Ohu. It is easy to draw but requires a strategy before you start drawing.

Have a great weekend.

No comments:

Post a Comment