test04x2 深灰背景上畫淺灰圓餅內接白色星形

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Sam Suan Chen
Posts: 34
Joined: Thu Mar 11, 2010 5:33 am
Location: 龍潭 32545 Taiwan
Contact:

test04x2 深灰背景上畫淺灰圓餅內接白色星形

Post by Sam Suan Chen »

/* CFDG 範例 04 */
# 定義規則 test04x2 在灰背景上畫淺灰圓餅內接白色星形

startshape test04

background { b -0.7 } # 深灰背景

rule test04 {
CIRCLE { b 0.7 } # 淺灰圓餅
star { b 1 s 0.5 r 24} // 用自訂的 star 畫白色星形縮小內接
}

path star {
6 * // 執行 6 次下列兩個動作
{ r 144 } // 轉 144 度
{ LINETO { x cos(210) y sin(210) } } // 畫線到星形頂點
CLOSEPOLY {} // 接到起點
}

# b 是 brightness 亮度的簡寫
# s 是 size 大小的縮寫
// r 是 rotate 轉向的縮寫
Attachments
test04x2.jpg
test04x2.jpg (20.13 KiB) Viewed 38186 times

Post Reply