Categories
Drawing Adinkra Symbols using Python

Dame Dame

Dame Dame means “chequered or checkered” as in the pattern on a chess or draught board. It is the symbol of intelligence, ingenuity, and strategy.

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

Analyzing the Symbol

Dame Dame consists of a filled square surrounded by an outer circle. The four sides of the square are connected to the circle by a shape that looks like a tong.

The Plan to Draw the Symbol

To draw Dame Dame, we first draw the filled square. Next we draw the outer circle.

The tong like shape connecting the square to the circle is drawn for all the four sides of the square.

The Algorithm to Draw the Symbol

The algorithm to draw Dame Dame is given below:

  1. Increase the pen size to 20 pixels
  2. Move the turtle to the position (-60, 60)
  3. Draw the inner filled square as a square of length 120 pixels
  4. Lift up the pen
  5. Move the pen to the position (0, -170)
  6. Draw a circle of radius 170
  7. Lift up the pen
  8. Set the heading of the pen to 0
  9. Move the pen to the position (60, 20)
  10. Draw the right handle
  11. Lift up the pen
  12. Set the heading of the pen to 0
  13. Draw the line joining the right handle to the circle
  14. Lift up the pen
  15. Set the heading of the pen to 90
  16. Move the pen to the position (-20, 60)
  17. Draw the top handle
  18. Lift up the pen
  19. Set the heading of the pen to 90
  20. Draw the line joining the top handle to the circle
  21. Lift up the pen
  22. Set the heading of the pen to 180
  23. Move the pen to the position (-60, -20)
  24. Draw the left handle
  25. Lift up the pen
  26. Set the heading of the pen to 180
  27. Draw the line joining the left handle to the circle
  28. Lift up the pen
  29. Set the heading of the pen to 270
  30. Move the pen to the position (20, -60)
  31. Draw the bottom handle
  32. Lift up the pen
  33. Set the heading of the pen to 270
  34. Draw the line joining the bottom handle to the circle

From the above steps, you will notice that steps (7-13), (14-20), (21-27) and (28-34) are similar. As a result, they would make a great candidate for a function.

Using Turtle Graphics

We will use the template.py file and rename it to damedame.py. The first task will be do increase the pen size of the turtle.

The code to do this is shown below:

turtle.pensize(20)

Next we draw the filled square. The code to do this is shown below:

turtle.setposition(-60, 60)
turtle.pendown()
turtle.begin_fill()
turtle.forward(120)
turtle.right(90)
turtle.forward(120)
turtle.right(90)
turtle.forward(120)
turtle.right(90)
turtle.forward(120)
turtle.right(90)
turtle.end_fill()

The generated image is shown below:

Next we draw the outer circle. The code to do this is shown below:

turtle.penup()
turtle.setposition(0, -170)
turtle.pendown()
turtle.circle(170)

The generated image is shown below:

Next we draw the right handle. The code to do this is shown below:

turtle.penup()
turtle.setheading(0)
turtle.setposition(60, 20)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

The generated image is shown below:

Now we draw the line that connects the right handle to the circle. The code to do this is shown below:

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

The generated image is shown below:

Next we draw the top handle. The code to do this is shown below:

turtle.penup()
turtle.setheading(90)
turtle.setposition(-20, 60)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

The generated image is shown below:

Now we draw the line that connects the top handle with the circle. The code to do this is shown below:

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

The generated image is shown below:

Next we draw the left handle. The code to do this is shown below:

turtle.penup()
turtle.setheading(180)
turtle.setposition(-60, -20)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

The generated image is shown below:

Now we draw the line that connects the left handle to the circle. The code to do this is shown below:

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

The generated image is shown below:

Next we draw the bottom handle. The code to do this is shown below:

turtle.penup()
turtle.setheading(270)
turtle.setposition(20, -60)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

The generated image is shown below:

Now we draw the line that connects the bottom handle to the circle. The code to do this is shown below:

Complete Code

"""
Project Name: Drawing Adinkra Symbols using Python
Symbol Name: Dame Dame
Developer Name: Truston Ailende
Email Address: trustonailende@gmail.com
"""
import turtle
import math
 
# Square
def drawSquare(length):
    turtle.penup()
    turtle.setposition(-length/2.0, length/2.0)
    turtle.pendown()
    for i in range(0, 4):
        turtle.forward(length)
        turtle.right(90)
    turtle.penup()
    turtle.home()
 
# Horizontal lines
def drawHorizontalLine(length, division):
    pixelSpace = int(length / division)
    half = int(length / 2)
    for j in range((-half + pixelSpace), half, pixelSpace):
        turtle.penup()
        turtle.setposition(-half, j)
        turtle.pendown()
        turtle.forward(length)
    turtle.penup()
    turtle.home()
 
# Vertical lines
def drawVerticalLine(length, division):
    pixelSpace = int(length / division)
    half = int(length / 2)
    turtle.right(90)
    for k in range((-half + pixelSpace), half, pixelSpace):
        turtle.penup()
        turtle.setposition(k, half)
        turtle.pendown()
        turtle.forward(length)
    turtle.penup()
    turtle.home()
 
# Draw the grid
turtle.speed(1000000)
drawSquare(400)
drawHorizontalLine(400, 40)
drawVerticalLine(400, 40)
 
# Change the colour mode
turtle.colormode(255)
 
# Change the pencolor to red
turtle.pencolor(255, 0, 0)
 
# Draw the horizontal centre line
turtle.setposition(-200, 0)
turtle.pendown()
turtle.forward(400)
turtle.penup()
 
# Draw the vertical centre line
turtle.setposition(0, 200)
turtle.setheading(270)
turtle.pendown()
turtle.forward(400)
 
# Reset all the properties
turtle.home()
turtle.pencolor(0, 0, 0)
 
# Place code here
# Set the pensize to 20
turtle.pensize(20)

# Draw the filled center square
turtle.setposition(-60, 60)
turtle.pendown()
turtle.begin_fill()
turtle.forward(120)
turtle.right(90)
turtle.forward(120)
turtle.right(90)
turtle.forward(120)
turtle.right(90)
turtle.forward(120)
turtle.right(90)
turtle.end_fill()

# Draw the outer circle
turtle.penup()
turtle.setposition(0, -170)
turtle.pendown()
turtle.circle(170)

# Draw the right handle
turtle.penup()
turtle.setheading(0)
turtle.setposition(60, 20)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

# Draw the line joining the right handle to the circle
turtle.penup()
turtle.setheading(0)
turtle.setposition(110, 0)
turtle.pendown()
turtle.forward(50)

# Draw the top handle
turtle.penup()
turtle.setheading(90)
turtle.setposition(-20, 60)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

# Draw the line joining the top handle to the circle
turtle.penup()
turtle.setheading(90)
turtle.setposition(0, 110)
turtle.pendown()
turtle.forward(50)

# Draw the left handle
turtle.penup()
turtle.setheading(180)
turtle.setposition(-60, -20)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

# Draw the line joining the left handle to the circle
turtle.penup()
turtle.setheading(180)
turtle.setposition(-110, 0)
turtle.pendown()
turtle.forward(50)

# Draw the bottom handle
turtle.penup()
turtle.setheading(270)
turtle.setposition(20, -60)
turtle.pendown()
turtle.forward(50)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(50)

# Draw the line joining the bottom handle to the circle
turtle.penup()
turtle.setheading(270)
turtle.setposition(0, -110)
turtle.pendown()
turtle.forward(50)

# End the program
turtle.done()

Where it Can be Found

I searched online but I was unable to find any reference to anyone using the Dame Dame symbol.

Summary

At the end of this post, we have successfully used the Python Turtle environment to draw the Dame Dame symbol.

The code for this series is available on GitHub. Please feel free to check it out.

Next time, we will look at the Epa symbol.

Support the Series

Using the Adinkra symbols, I created the Adinkra Notebooks Collection.

You can support this series by buying one of them.

Leave a Reply

Your email address will not be published.

0 Shares
Tweet
Share
Pin
Share
%d bloggers like this: