Monday, January 16, 2023

Python Turtle Graphics Drawing - Xiaomi Logo

Python Turtle Graphics Drawing - Xiaomi Logo

Youtube


Source code:

from turtle import *

setup(580,580)
title('Xiaomi')
color('#F76400')

def bar(x, y, w, h):
    up()
    goto(x, y)
    seth(90)
    down()
    begin_fill()
    fd(h)
    rt(90)
    fd(w)
    rt(90)
    fd(h)
    rt(90)
    fd(w)
    end_fill()

up()
goto(-230, 250)
down()
begin_fill()
for i in range(4):
    fd(460)
    circle(-20,90)
end_fill()

color('white')
up()
goto(-145, -93)
seth(90)
down()
begin_fill()
fd(186)
rt(90)
fd(155)
lt(1.4)
circle(-52.8,88.4)
rt(3)
fd(136)
rt(90)
fd(46)
rt(90)
fd(120)
lt(0.7)
circle(27.4,84.3)
lt(5.1)
fd(93)
lt(90)
fd(147)
rt(90)
fd(45)
end_fill()

bar(-64,-93,46,114)
bar(100,-93,46,186)

hideturtle()
done()

No comments:

Post a Comment

Python Turtle Graphics Drawing - Gigabyte

 Python Turtle Graphics Drawing - Gigabyte Youtube Source code: from turtle import * setup ( 600 , 600 ) color ( '#2D68AE' ) up (...