circular.py

Created by schraf

Created on October 03, 2023

881 Bytes

Alphabet Circular Glyphs | Youtube channel


from turtle import *

s = 10
w = 160 // s
speed(0)

def trait(x, y, a, b, r, u):
 penup()
 goto(x + a * u, y + b * u)
 setheading(r)
 pendown()
 fd(2 * u)    

def croix(x, y, u):
 trait(x, y, 0, -1, 90, u)
 trait(x, y, -1, 0, 0, u)

def arc(x, y, n, u):
 p = (n + n // 4) % 4
 xc = (0, 1, 0, -1)[p]
 yc = (1, 0, -1, 0)[p]
 penup()
 goto(x + u * xc, y + u * yc)
 setheading(180 - 90 * p)
 pendown()
 circle(u, 90 * ( 1 + n // 4))

def car(x, y, c, u):
 m = c.upper()
 n = ord(m) - 65
 croix(x, y, u)
 if "A" <= m <= "Z":
  arc(x, y, n, u)
  if m >= "N": arc(x, y, n - 13, u // 2)

ph = "All human beings are bornfree and equal in dignityand rights  they are endowed with reason and conscience and should act towards one another in a spirit of brotherhood "

for i,c in enumerate(ph):
 car(-160 + s + 2 * s * (i % w), 110 - s - 2 * s * (i // w), c, s)

hideturtle()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.