![TikZ 图片的断线](https://linux22.com/image/446864/TikZ%20%E5%9B%BE%E7%89%87%E7%9A%84%E6%96%AD%E7%BA%BF.png)
使用 TikZ 连续处理大量图片时,我希望有断线行为,从而产生更均匀的线条。但我做不到。
\input{tikz}
\def\maxangle{30}
\pgfmathsetseed{7}
\foreach \i in {red, green, blue, red!40!blue, yellow, yellow!58!blue}
\foreach \i in {red, green, blue, red!40!blue, yellow, yellow!58!blue}
{%
\tikzpicture[x=0.025\hsize,line width=8pt, cap=round]
\draw[rotate=rand*\maxangle,\i]
(0,0) -- +(0:5)
-- +(90:5) -- cycle;
\endtikzpicture % I've tried putting some glues
%% and penalties here, but they
%% haven't work well.
%% Using chars as separators
%% worked "better".
}%
\end
我尝试在每幅画的末端涂上一些胶水。有些效果比其他的要好,但没有一种看起来是可控的。
我怎样才能在 Plain TeX 中实现我的目标?如何获得类似于字符断线的图片序列?
答案1
我只是\raggedbottem
为了避免 vbox 页面未满警告并将\hfil
tikz 沿着每一行展开。
\input{tikz}
\raggedbottom
\def\maxangle{30}
\pgfmathsetseed{7}
\foreach \i in {red, green, blue, red!40!blue, yellow, yellow!58!blue}
\foreach \i in {red, green, blue, red!40!blue, yellow, yellow!58!blue}
{%
\tikzpicture[x=0.025\hsize,line width=8pt, cap=round]
\draw[rotate=rand*\maxangle,\i]
(0,0) -- +(0:5)
-- +(90:5) -- cycle;
\endtikzpicture % I've tried putting some glues
%% and penalties here, but they
%% haven't work well.
%% Using chars as separators
%% worked "better".
\hfil
}%
\bye