A seemingly simple image of the Celtic Shield Knot generated by a quite complicated Python Turtle code. The blue background hides unwanted lines in the drawing.
Feel free to copy the basic Python Turtle code that is given below. Don't hesitate to ask questions about the code if you have any. Enjoy! Please comment, like, or subscribe :)
Incidentally, for more graphics and variations, please visit my author url at https://www.amazon.com/author/basicpy...
import turtle
t = turtle.Turtle()
screen = turtle.Screen()
t.pensize(4)
Radius = 240
band_width = Radius /8
radius = Radius - band_width
y = 0
def circle():
t.color("white")
t.begin_fill()
t.circle(Radius)
t.end_fill()
x = Radius - band_width
t.goto(x, y)
t.color("white", "blue")
t.begin_fill()
t.circle(radius)
t.end_fill()
def straight_bands():
t.color("white")
for i in range(2):
t.pendown()
t.begin_fill()
for j in range(2):
t.forward(Radius + radius)
t.left(90)
t.forward(band_width)
t.left(90)
t.end_fill()
t.penup()
t.left(90)
t.forward(2 * band_width)
t.right(90)
def gap_in_circle():
t.color("blue")
t.begin_fill()
for i in range(2):
t.forward(.74 * band_width)
t.left(90)
t.forward(1.05 * band_width)
t.left(90)
t.end_fill()
def overlap_edges():
t.forward(1.24 * band_width)
t.penup()
t.left(90)
t.forward(0.7 * band_width)
t.pendown()
t.forward(1.24 * band_width)
screen.bgcolor("blue")
t.penup()
t.forward(Radius)
t.left(90)
t.pendown
circle()
t.penup()
t.home()
t.forward((Radius + radius) / 2)
for i in range(2):
t.left(90)
t.forward(1.5 * band_width)
t.left(90)
straight_bands()
t.home()
t.left(90)
t.forward((Radius + radius) / 2)
for i in range(4):
t.penup()
t.home()
t.left(i * 90)
t.forward(Radius)
t.right(90)
t.forward(.75 * band_width / 2)
t.left(180)
t.pendown()
gap_in_circle()
t.color("blue")
t.pensize(8)
for i in range(4):
t.penup()
t.home()
t.left(i * 90)
t.forward(0.9 * band_width / 2)
t.right(90)
t.forward(0.6 * band_width / 2)
t.left(90)
t.pendown()
overlap_edges()
t.hideturtle()
screen.exitonclick()