test05x1 深灰背景上畫淺灰圓餅內的五星國徽 (用 rule 規則畫星)

Moderators: MtnViewJohn, chris, mtnviewmark

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

test05x1 深灰背景上畫淺灰圓餅內的五星國徽 (用 rule 規則畫星)

Post by Sam Suan Chen »

/* CFDG 範例 05 */
# 定義規則 test05x1 在深灰背景上畫淺灰圓餅內的五星國徽 (用 rule 規則畫星)

startshape test05

background { b -0.7 } # 深灰背景

rule test05 {
CIRCLE { b 0.7 } # 淺灰圓餅
star { b 1 x -.2 s 0.27 r 24} // 用自訂的 star 畫白色星形縮小內接
4*{x .03 r 44} {star {b 1 s 0.09 x .16 y -.29 r -10}}
}

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

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

Post Reply