是2022年北京冬季奧運會(huì )的吉祥物。 將熊貓形象與富有超能量的冰晶外殼相結合,頭部外殼造型取自冰雪運動(dòng)頭盔,裝飾彩色光環(huán),整體形象酷似航天員?,F在全國乃至全世界都一墩難求,工廠(chǎng)們都在加班加點(diǎn)的生產(chǎn)冰墩墩,作為一個(gè)制造企業(yè)信息化系統的供應商,我們用程序代碼來(lái)繪制一個(gè)可愛(ài)的冰墩墩給工廠(chǎng)智能化生產(chǎn)。
import turtle as t import math,turtle # 設置速度 t.speed(1000) # 速度 t.delay(5) # 延遲 # turtle.tracer(False) # 雙耳 # 左耳 t.penup() t.goto(-150, 200) t.setheading(160) t.begin_fill() t.pendown() t.circle(-30, 230) t.setheading(180) t.circle(37, 90) t.end_fill() # 右耳 t.penup() t.goto(60, 200) t.setheading(20) t.begin_fill() t.pendown() t.circle(30, 230) t.setheading(0) t.circle(-37, 90) t.end_fill() # 頭 t.pensize(5) t.penup() t.goto(-113, 237) t.setheading(30) t.pendown() t.circle(-134, 60) t.penup() t.goto(-150, 200) t.setheading(-120) t.pendown() t.circle(200, 80) t.penup() t.goto(60, 200) t.setheading(-60) t.pendown() t.circle(-200, 80) t.penup() t.setheading(210) t.pendown() t.circle(-120, 60) # 雙眼 # 左眼 # 眼圈 t.penup() t.goto(-140, 100) t.setheading(-45) t.begin_fill() t.pendown() a = 0.2 for i in range(120): if 0 <= i < 30 or 60 <= i < 90: a = a + 0.1 t.lt(3) # 向左轉3度 t.fd(a) # 向前走a的步長(cháng) else: a = a - 0.1 t.lt(3) t.fd(a) t.end_fill() # 眼白 t.fillcolor("white") t.penup() t.goto(-103, 125) t.setheading(0) t.begin_fill() t.pendown() t.circle(13, 360) t.end_fill() # 眼珠 t.fillcolor("sienna") t.pencolor("sienna") t.penup() t.goto(-102, 133) t.setheading(0) t.begin_fill() t.pendown() t.circle(5, 360) t.end_fill() # 右眼 # 眼圈 t.penup() t.goto(50, 100) t.setheading(45) t.fillcolor("black") t.pencolor("black") t.begin_fill() t.pendown() a = 0.2 for i in range(120): if 0 <= i < 30 or 60 <= i < 90: a = a + 0.1 t.lt(3) # 向左轉3度 t.fd(a) # 向前走a的步長(cháng) else: a = a - 0.1 t.lt(3) t.fd(a) t.end_fill() # 眼白 t.fillcolor("white") t.penup() t.goto(13, 125) t.setheading(0) t.begin_fill() t.pendown() t.circle(13, 360) t.end_fill() # 眼珠 t.fillcolor("sienna") t.pencolor("sienna") t.penup() t.goto(12, 133) t.setheading(0) t.begin_fill() t.pendown() t.circle(5, 360) t.end_fill() # 鼻子 t.pencolor("black") t.fillcolor("black") t.penup() t.goto(-55, 133) t.begin_fill() t.pendown() t.fd(20) t.seth(-120) t.fd(20) t.seth(120) t.fd(20) t.end_fill() # 嘴 t.penup() t.goto(-70, 110) t.setheading(-30) t.fillcolor("red") t.begin_fill() t.pendown() t.circle(50, 60) t.setheading(-120) t.circle(-100, 15) t.circle(-15, 90) t.circle(-100, 15) t.end_fill() # 四肢 # 左臂 t.penup() t.goto(-175, 100) t.fillcolor("black") t.begin_fill() t.setheading(-120) t.pendown() t.fd(100) t.setheading(-110) t.circle(20, 180) t.fd(30) t.circle(-5, 160) t.end_fill() # 右臂 t.penup() t.goto(85, 100) t.setheading(60) t.begin_fill() t.pendown() t.fd(100) t.setheading(70) t.circle(20, 180) t.fd(30) t.circle(-5, 160) t.end_fill() # 小紅心 t.penup() t.pencolor("red") t.fillcolor('red') t.goto(105, 200) t.begin_fill() t.pendown() t.circle(-5, 180) t.setheading(90) t.circle(-5, 180) t.setheading(-120) t.fd(17) t.penup() t.goto(105, 200) t.pendown() t.setheading(-60) t.fd(17) t.end_fill() t.pencolor("black") t.fillcolor("black") # 左腿 t.penup() t.goto(-120, -45) t.begin_fill() t.pendown() t.setheading(-90) t.circle(-140, 20) t.circle(5, 109) t.fd(30) t.circle(10, 120) t.setheading(90) t.circle(-140, 10) t.end_fill() # 右腿 t.penup() t.goto(30, -45) t.begin_fill() t.pendown() t.setheading(-90) t.circle(140, 20) t.circle(-5, 109) t.fd(30) t.circle(-10, 120) t.setheading(90) t.circle(140, 10) t.end_fill() t.done()
Copyright © 2004-2022 深圳市華晨信息技術(shù)有限公司 版權所有 粵ICP備18059119號-3| 技術(shù)支持:快速開(kāi)發(fā)平臺