Created
May 25, 2025 14:05
-
-
Save ChirimenHOLIDAY/1076c1430e5c9131f25ee2c596c831b8 to your computer and use it in GitHub Desktop.
PostScriptでねこちゃんとうさぎちゃんの顔を描くコードです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!PS | |
%改変も改変後の再配布もOK。イラスト的な表現のある性質上、コード及び描画結果ををそのまま再配布する際はクレジット表記をお願いします。©Chirimen HOLIDAY | |
newpath | |
20 30 moveto %顔の右側面 | |
22 50 lineto %耳の頂点に向かって線を引く | |
30 40 lineto %右耳おわり | |
40 40 lineto %頭頂部 | |
48 50 lineto %耳の頂点に向かって線を引く | |
50 30 lineto %左耳おわり | |
50 22 44 20 40 20 curveto %左頬 | |
30 20 lineto %あご | |
26 20 20 22 20 30 curveto %右頬 | |
0 setgray | |
stroke | |
newpath %目の描画 | |
30 28 translate %右目の中心の座標に移動する | |
.5 1 scale %x軸を0.5倍とし縦長の楕円を作る | |
0 0 2 0 360 arc %360度の円を描く | |
0 setgray | |
fill | |
newpath | |
20 0 2 0 360 arc %目の間隔は10pt、scaleによってx軸が0.5倍されているためここの座標は20になる | |
0 setgray | |
fill | |
showpage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!PS | |
%改変も改変後の再配布もOK。イラスト的な表現のある性質上、コード及び描画結果ををそのまま再配布する際はクレジット表記をお願いします。©Chirimen HOLIDAY | |
newpath | |
20 30 moveto %ここはねこちゃんと同じ | |
21 40 lineto %y軸はねこちゃんの耳の開始点に揃える | |
21 50 lineto %ここから右耳開始 まずは四角くうさ耳を生やす | |
34 50 lineto | |
34 40 lineto %右耳おわり | |
36 40 lineto %耳が大きいため激短い頭頂部 | |
36 50 lineto %左耳開始 | |
49 50 lineto | |
49 40 lineto %左耳おわり | |
50 30 lineto | |
50 22 44 20 40 20 curveto %左頬 | |
30 20 lineto %あご | |
26 20 20 22 20 30 curveto %右頬 | |
0 setgray | |
fill | |
gsave %目を描く scaleとtranslateがnewpachを貫通してしまうためgsave/grestoreで囲って影響を受けないようにし、座標を分かりやすくした | |
newpath | |
30 28 translate | |
.5 1 scale | |
0 0 2 0 360 arc | |
1 setgray %顔が黒のため目は白に | |
fill | |
grestore | |
gsave %片目も同様 | |
newpath | |
40 28 translate | |
.5 1 scale | |
0 0 2 0 360 arc | |
1 setgray | |
fill | |
grestore %両目終わり | |
gsave %ここから耳の丸い部分を半円で描画する | |
newpath | |
27.5 50 translate %耳の中心部分の座標 | |
0 0 6.5 0 180 arc %耳の幅が13ptなので半径は6.5 | |
0 setgray | |
fill | |
grestore | |
gsave %片耳も同様 | |
newpath | |
42.5 50 translate | |
0 0 6.5 0 180 arc | |
0 setgray | |
fill | |
grestore | |
showpage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment