Saturday, February 17, 2024

Python Turtle Graphics Drawing - GOJEK

 Python Turtle Graphics Drawing - GOJEK

Youtube



Source code:

import math
from turtle import *
SCALE=3.5
setup(560,560)
shape('turtle')
color('#00AA13')
up()
fd(22.5*SCALE)
lt(90)
down()
begin_fill()
circle(22.5*SCALE)
end_fill()
up()
lt(90)
fd(22.5*SCALE)
lt(100)
R = 48.75
y = 11.25
x = math.sqrt(R*R-y*y)
ang = math.degrees(math.atan2(y,x))
ang2 = 180-(ang+90)
angt = (180-ang)/2
ang3 = angt-ang2
fd(x*SCALE)
lt(90)
fd(y*SCALE)
lt(ang3*2)
down()
pensize(22.5*SCALE)
circle(R*SCALE,340-ang*2)
done()

Tuesday, February 13, 2024

Python Turtle Graphics Drawing - WALL'S Logo

Python Turtle Graphics Drawing - WALL'S Logo

Youtube


Source code:

from turtle import *
from math import atan2,degrees

LOGO = [
    [-68,11.6],[-117.6,44.9],[-105,90],[-85.7,133.8],
    [-29.3,118],[-6,75],[-2.6,69.5],[1.9,71.1],[6.2,77.5],
    [45.7,133.4],[97.9,122],[106,77],[114.2,6.9],
    [45.2,-38.6],[0,-48],[-82.9,-44.8],[-188.1,-1.9],
    [-221,63],[-251.2,144.1],[-191.8,184.4],[-121,189],
    [-71.9,189.4],[-32.8,173.8],[-6.5,151.9],[-1.4,147.1],
    [2.4,148.7],[5.9,151.9],[95.5,212.5],[180.4,186.6],
    [212,141],[263.5,63.7],[172.5,-15.9],[131.9,-45.1],
    [114.9,-56.4],[121.3,-62.1],[135.8,-55.4],[251.4,-11.3],
    [291,70.7],[273,140],[234.8,246.2],[83.6,247.4],
    [5.6,188.1],[0.5,183.8],[-2.5,184.2],[-7,187.6],
    [-93.7,250.3],[-222.9,234],[-259,178],[-306.9,105.2],
    [-263,19.8],[-155,-37],[-90.9,-66.1],[-42.8,-75.6],
    [0,-78],[109.5,-53],[176.7,41.3],[157,99],[138.8,165],
    [64.6,162.7],[6.2,113.8],[-0.4,107],[-3,108.1],[-8,114],
    [-50.1,159.4],[-118.8,167.2],[-156,121],[-183.2,78],
    [-149.2,31.5],[-100,9],[-68.9,-8.2],[-37.7,-16.4],
    [-11,-18],[-3.7,-19.3],[-2.9,-12.6],[-10,-11],
]

S1 = [
    [215.5,-206.2],[227.3,-207.7],[231.5,-197.2],
    [233.6,-186.6],[220.5,-183.9],[213.5,-181.6],
    [188.5,-173],[188.2,-150.3],[194,-138],
    [204.3,-113.3],[237.2,-113],[253,-137],
]

S2 = [
    [228.7,-139.9],[218.7,-140],[214.6,-145.3],
    [207.7,-157.1],[220.3,-161],[230,-164],
    [260.5,-173.1],[256.5,-205.7],[242.8,-218.7],
    [229.9,-230.8],[204.3,-230.4],[190,-209],
]

def cbezto(b,c,d):
    speed(150)
    a=pos()
    t = 0.0
    while t <= 1.0:
        t3 = t**3
        t2 = t**2
        f1 = -t3+3*t2-3*t+1
        f2 = 3*t3-6*t2+3*t
        f3 = -3*t3+3*t2
        f4 = t3
        x = a[0]*f1 + b[0]*f2 + c[0]*f3 + d[0]*f4
        y = a[1]*f1 + b[1]*f2 + c[1]*f3 + d[1]*f4
        d1 = -3*t2+6*t-3
        d2 = 9*t2-12*t+3
        d3 = -9*t2+6*t
        d4 = 3*t2
        dx = a[0]*d1 + b[0]*d2 + c[0]*d3 + d[0]*d4
        dy = a[1]*d1 + b[1]*d2 + c[1]*d3 + d[1]*d4
        angr = atan2(dy, dx)
        seth(degrees(angr))
        goto(x, y)
        t += 0.05
    goto(d)
    speed(5)

def L():
    begin_fill()
    fd(22)
    rt(90)
    fd(82)
    lt(90)
    fd(34)
    rt(90)
    fd(22)
    rt(90)
    fd(56)
    rt(90)
    fd(104)
    end_fill()


setup(640,640)
speed(5)
color('red')
shape('turtle')
up()
rt(132.3)
fd(14.9)
down()
begin_fill()
for i in range(len(LOGO)//3):
    cbezto(LOGO[i*3],LOGO[i*3+1],LOGO[i*3+2])
end_fill()

#W
up()
lt(43.5)
fd(269.7)
down()
begin_fill()
rt(178.7)
fd(22.4)
rt(95.9)
fd(65.2)
lt(137.9)
fd(65.6)
rt(138.2)
fd(66.1)
lt(138.5)
fd(66.5)
rt(96.6)
fd(21.5)
rt(85.1)
fd(110.7)
rt(134.3)
fd(61.8)
lt(134.3)
fd(61.8)
rt(134.8)
fd(110.3)
end_fill()

#A
up()
rt(147.5)
fd(161.5)
down()
begin_fill()
lt(98.8)
fd(114.9)
rt(127.1)
fd(114)
rt(88.8)
fd(21.5)
rt(90)
fd(21.5)
lt(62.2)
fd(45)
lt(68.2)
fd(21.5)
rt(94.8)
fd(22.4)
end_fill()

#A
up()
lt(255.7)
fd(78)
down()
color('white')
begin_fill()
rt(163.3)
fd(31.8)
lt(114.1)
fd(25)
lt(112.5)
fd(31.4)
end_fill()

color('red')
#L
up()
rt(84)
fd(81.9)
down()
rt(28.4)
L()
#L
up()
lt(270)
fd(80)
down()
L()
#S
up()
lt(231.1)
fd(140.1)
down()
begin_fill()
lt(83.5)
fd(21.8)
for i in range(4):
    cbezto(S1[i*3],S1[i*3+1],S1[i*3+2])
rt(83.9)
fd(22.6)
for i in range(4):
    cbezto(S2[i*3],S2[i*3+1],S2[i*3+2])
end_fill()

# '
up()
lt(2.4)
fd(71.6)
down()
begin_fill()
rt(61.9)
fd(44.9)
rt(96.9)
fd(21.5)
rt(90.5)
fd(44.3)
rt(88.3)
fd(15.7)
end_fill()
hideturtle()
done()

Sunday, February 11, 2024

Python Turtle Graphics Drawing - Old CAT Logo

 Python Turtle Graphics Drawing - Old CAT Logo

Youtube


Source code:

from turtle import *
setup(640,640)
color('gold')
up()
lt(135)
fd(424.3)
down()
begin_fill()
rt(135)
fd(600)
rt(90)
fd(600)
rt(90)
fd(600)
rt(90)
fd(600)
end_fill()

up()
rt(119.3)
fd(613.4)
down()
color('black')
begin_fill()
lt(119.3)
circle(235)
end_fill()
up()
lt(47.7)
fd(371.7)
down()
color('gold')
begin_fill()
lt(132.3)
fd(495)
lt(90)
fd(80)
lt(90)
fd(205)
rt(90)
fd(210)
lt(90)
fd(80)
lt(90)
fd(210)
rt(90)
fd(210)
lt(90)
fd(80)
end_fill()
done()

Saturday, February 10, 2024

Python Turtle Graphics Drawing - AMD Logo

  Python Turtle Graphics Drawing - AMD Logo






Source code:
from turtle import *
from math import atan2,degrees

def cbezto(b,c,d):
    a=pos()
    t = 0.0
    while t <= 1.0:
        t3 = t**3
        t2 = t**2
        f1 = -t3+3*t2-3*t+1
        f2 = 3*t3-6*t2+3*t
        f3 = -3*t3+3*t2
        f4 = t3
        x = a[0]*f1 + b[0]*f2 + c[0]*f3 + d[0]*f4
        y = a[1]*f1 + b[1]*f2 + c[1]*f3 + d[1]*f4
        d1 = -3*t2+6*t-3
        d2 = 9*t2-12*t+3
        d3 = -9*t2+6*t
        d4 = 3*t2
        dx = a[0]*d1 + b[0]*d2 + c[0]*d3 + d[0]*d4
        dy = a[1]*d1 + b[1]*d2 + c[1]*d3 + d[1]*d4
        angr = atan2(dy, dx)
        seth(degrees(angr))
        goto(x, y)
        t += 0.05
    goto(d)


up()
lt(121.9)
fd(431.2)
down()
begin_fill()
rt(121.9)
fd(446)
rt(90)
fd(445)
rt(135.2)
fd(174.7)
rt(44.8)
fd(199)
lt(90)
fd(200)
rt(44.8)
fd(173.2)
end_fill()

up()
lt(175.5)
fd(190)
down()
begin_fill()
rt(40.7)
fd(181)
lt(90)
fd(180)
rt(135)
fd(175.4)
rt(45)
fd(182)
rt(90)
fd(179)
rt(45)
fd(178.2)
end_fill()

up()
rt(155.7)
fd(620.9)
down()
begin_fill()
lt(178.5)
fd(198.7)
rt(67.8)
fd(52)
rt(66)
fd(201.4)
rt(114)
fd(49)
rt(66.6)
fd(40.3)
lt(66.6)
fd(82)
lt(70.6)
fd(39.2)
rt(70.6)
fd(49)
end_fill()

up()
lt(180)
fd(230)
down()
begin_fill()
lt(90)
fd(184)
rt(90)
fd(41)
rt(49.5)
fd(90.8)
lt(98.9)
fd(90.8)
rt(49.5)
fd(39)
rt(90)
fd(184)
rt(90)
fd(45)
rt(90)
fd(116)
lt(139.7)
fd(77.3)
rt(49.7)
fd(7)
rt(49.7)
fd(77.3)
lt(139.7)
fd(116)
rt(90)
fd(46)
end_fill()

up()
lt(218.2)
fd(297.7)
down()
begin_fill()
rt(38.2)
fd(79)
cbezto((274,-175),(294,-196),(311,-219))
cbezto((327,-243),(328,-287),(311,-315))
cbezto((295,-341),(270,-355),(229,-359))
rt(7.2)
fd(89)
rt(90)
fd(184)
end_fill()

color('white')
up()
lt(106.5)
fd(405.6)
down()
begin_fill()
rt(127.7)
fd(77.3)
rt(136.1)
fd(78)
rt(112.6)
fd(58)
end_fill()

up()
lt(175.7)
fd(470.3)
down()
begin_fill()
rt(175.7)
fd(34)
rt(90)
fd(116)
rt(90)
fd(34)
cbezto((260,-209),(275,-237),(276,-260))
cbezto((278,-297),(261,-324),(220,-325))
end_fill()
up()
hideturtle()
done()

Python Turtle Graphics Drawing - Gigabyte

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