
直方体(rectfill)を使用し、幅(i)に拡大率(k)を懸けて次第に大きくしていきます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 720 720 %%HiResBoundingBox: 0 0 720 720 %%CropBox: 0 0 720 720 %%Title: rectfillによる直線の幅の変化 %%Creator:Studio Fruit Jam / Toyokazu Nishi %%Copyright:Studio Fruit Jam / Toyokazu Nishi %%CreationDate:2015年12月23日水曜日17:18:30 %%ModificationDate:2018年5月18日金曜日午後6:23:42 %%ModificationDate:2018年8月8日 水曜日午前9:19:57 % 参考:特選グラフィックスデザイン % ================ 座標変換 ================ 360 360 translate 1 dup scale % ================ 背景 ================= 0.51764 0.82352 0.75686 setrgbcolor -360 360 720 -720 rectfill % ====================== 初期値 /DeviceRGB setcolorspace % カラースペース設定 0.8745 0.49803 0.59607 setrgbcolor /x 0 def % x初期位置 /y -360 def % y底辺座標 /h 720 def % 高さ /k .015 def % 拡大率 %% ================================================ % メイン % ================================================ newpath % パスの初期化 x y 0.1 h rectfill % センターの線を描画 0 5 360 { /i exch def x i add y i k mul h rectfill % (x+i,y i*k,h) 右に向かって線を描画 x i sub y i k mul h rectfill % (x-i,y i*k,h) 左に向かって線を描画 } for |

線の描画をプロシージャ化し、4個配置しました。右上と左下は回転しています。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 0 0 720 720 %%HiResBoundingBox: 0 0 720 720 %%CropBox: 0 0 720 720 %%Title: rectfillによる直線の幅の変化 %%Creator:Studio Fruit Jam / Toyokazu Nishi %%Copyright:Studio Fruit Jam / Toyokazu Nishi %%CreationDate:2015年12月23日水曜日17:18:30 %%ModificationDate:2018年5月18日金曜日午後6:23:42 %%ModificationDate:2018年8月8日 水曜日午前10:33:15 % 特選グラフィックスデザイン % ================ 座標変換 ================ 360 360 translate 1 dup scale % ================ 背景 ================= %0.51764 0.82352 0.75686 setrgbcolor %-360 360 720 -720 rectfill % ====================== 初期値 /DeviceRGB setcolorspace % カラースペース設定 %0.8745 0.49803 0.59607 setrgbcolor 0 0 0 setrgbcolor /x 0 def % x初期位置 /y -360 def % y底辺座標 /h 720 def % 高さ /k .015 def % 拡大率 /ds 360 def % 描画サイズ /w ds 2 mul def /init { 0 dup translate } def % 座標の原点を中央に移動 /c1 { /rc 0.90196 def /gc 0.51372 def /bc 1 def} def % 以下カラー設定 /c2 { /rc 0.49803 def /gc 0.51764 def /bc 1 def } def /c3 { /rc 0.40784 def /gc 0.88235 def /bc 0.9098 def } def /c4 { /rc 0.37647 def /gc 0.87843 def /bc 0.59215 def } def /line { % グラデの線を描くプロシージャ rc gc bc setrgbcolor % 色設定 ds neg dup w dup rectfill % バックのタイル 0 0 0 setrgbcolor x y 0.1 h rectfill % センターの線を描画 0 5 360 { /i exch def x i add y i k mul h rectfill % (x+i,y i*k,h) 右に向かって線を描画 x i sub y i k mul h rectfill % (x-i,y i*k,h) 左に向かって線を描画 } for } def % ================================================ % メイン % ================================================ gsave gsave gsave % グラフィックス状態を3回保存 init c1 .5 dup scale ds neg ds translate line % パターンを縮小して左上に配置 grestore % グラフィックス状態を復帰 init c2 .5 dup scale ds ds translate 90 rotate line % 右上に回転して配置 grestore init c3 .5 dup scale ds ds neg translate line % 左下に配置 grestore init c4 .5 dup scale ds neg ds neg translate 90 rotate line % 右下に回転して配置 |
コメント