TikZ/PGF 覚書(6) 手書き風描画繰返模様 [TikZ/PGF]
新年度のバタバタで暫し空きましたが再開。
今回はEscher風の繰り返し模様にチャレンジです。
繰り返しなのですが手書き風なので,
よく見れば,一回一回の線の様子が違います。
それでも塗りが均質なので,
あまり手描きには見えませんが。
肝心なソースのメイン部分は
\begin{tikzpicture}[scale=2,pencildraw/.style={decorate,decoration={random steps,segment length=3pt,amplitude=0.6pt}}] \foreach \x in {-3,...,3}{\foreach \y in {-3,...,3}{ \coordinate (strtpnt) at (\x,\y); \pgfmathsetmacro{\redc}{abs(\x+\y)/6}; \pgfmathsetmacro{\grec}{1-\redc/2}; \xdefinecolor{MyColor}{rgb}{\redc, \grec, 0.1}; \draw [pencildraw,fill=MyColor,line width=2 pt,nearly opaque,cap=rect] (strtpnt)--% ++(0.2,-0.1)--++(0.8,0.1)--++(-0.1,0.5)--++(0.1,0.5)--++(-0.8,-0.1)--++(-0.2,0.1)--++(-0.1,-0.5)--cycle coordinate (strtpnt); }} \end{tikzpicture}です。 スコープを使う手もあると思うのですが それは後日試してみる事に。 ではでは。
コメント 0