Loading design...

A beautiful string art / geometric string pattern created with Python Turtle. Read the code below, copy it, and try it in your own Python environment.
from turtle import *
import colorsys as cs
bgcolor('black')
tracer(50)
hideturtle()
speed(0)
width(1)
for l in range(40):
num_squares = 6 + l
radius = 20 + l * 5
square_size = 10 + l * 0.5
for i in range(num_squares):
hue = (l / 40 + i / num_squares) / 2
rgb = cs.hsv_to_rgb(hue, 0.8, 1.0)
color(rgb)
penup()
goto(0, 0)
setheading(i * (360 / num_squares))
pendown()
forward(radius)
for _ in range(4):
forward(square_size)
right(90)
right(l * 2)
done()