您現在的位置是:首頁 > 攝影首頁攝影

用python畫Volkswagen大眾logo圖形

由 楚姣賢閒談 發表于 攝影2022-12-20
簡介原始碼解釋:from turtle import*#呼叫turtle庫speed(10)#設定畫圖速度width(1)#設定畫筆粗細penup()#把畫筆提起goto(0,-230)#把畫筆挪到這個座標

掃描電鏡圖怎麼加標尺

開啟百度App

用python畫Volkswagen大眾logo圖形

用python畫Volkswagen大眾logo圖形

用python畫Volkswagen大眾logo圖形,原始碼如下:

from turtle import*

speed(10)

width(1)

penup()

goto(0,-230)

pendown()

color(“#6091C3”)

begin_fill()

circle(230)

end_fill()

penup()

goto(0,-200)

pendown()

color(“white”)

begin_fill()

circle(200)

end_fill()

penup()

goto(0,-170)

pendown()

color(“#6091C3”)

begin_fill()

circle(170)

end_fill()

circle(170,110)

color(“white”)

begin_fill()

lt(134)

fd(260)

rt(130)

fd(114)

lt(132)

fd(114)

rt(130)

fd(260)

rt(47)

circle(-170,14)

rt(119)

fd(210)

lt(130)

fd(70)

rt(66)

fd(39)

rt(66)

fd(70)

lt(130)

fd(213)

rt(119)

circle(-170,14)

end_fill()

lt(180)

circle(170,37)

begin_fill()

lt(98)

fd(175)

rt(66)

fd(40)

rt(66)

fd(175)

rt(80)

circle(-170,10)

rt(89)

fd(160)

lt(132)

fd(159)

rt(89)

circle(-170,10)

end_fill()

done()

原始碼結束。

原始碼解釋:

from turtle import* #呼叫turtle庫

speed(10) #設定畫圖速度

width(1) #設定畫筆粗細

penup() #把畫筆提起

goto(0,-230) #把畫筆挪到這個座標點

pendown() #把畫筆放下,開始畫圖

color(“#6091C3”) #定義畫筆顏色

begin_fill() #開始填充

circle(230) #畫圓

end_fill() #填充結束

penup() #提筆

goto(0,-200) #移動到這個座標點

pendown() #放下畫筆,開始畫圖

color(“white”) #定義顏色

begin_fill() #開始填充

circle(200) #畫圓

end_fill() #結束填充

penup() #提筆

goto(0,-170) #移動到這個座標點

pendown() #放下畫筆,開始畫圖

color(“#6091C3”) #定義顏色

begin_fill() #開始填充

circle(170) #畫圓

end_fill() #填充結束

circle(170,110) #畫圓

color(“white”) #定義顏色

begin_fill() #開始填充

lt(134) #向左轉134度

fd(260) #向前走260

rt(130) #想右轉130度

fd(114) #向前走114

lt(132) #向左轉132度

fd(114) #向前114

rt(130) #向右130

fd(260) #向前260

rt(47) #向右轉47度

circle(-170,14) #畫圓

rt(119) #向右轉119度

fd(210) #向前210

lt(130) #向左旋轉130度

fd(70) #向前走70

rt(66) #向右轉66度

fd(39) #向前39

rt(66) 向右轉66度

fd(70) 向前走70

lt(130) 像左轉130

fd(213) 向前213

rt(119) 向右轉119度

circle(-170,14) 畫圓

end_fill() 結束填充

lt(180) 向左轉180度

circle(170,37) 畫圓

begin_fill() 開始填充

lt(98) 向左轉98度

fd(175) 向前175

rt(66) 向右轉66度

fd(40) 向前40

rt(66) 向右轉66度

fd(175) 向前175

rt(80) 向右轉80度

circle(-170,10) 畫圓

rt(89) 向右轉89度

fd(160) 向前160

lt(132) 向左轉132度

fd(159) 向前159

rt(89) 向右轉89度

circle(-170,10) 畫圓

end_fill() 結束填充

done() 結束