我想知道是否可以使用 LaTeX 工具来生成受 Faber Finds 项目启发的书籍封面。
http://blog.fabric.ch/index.php?/archives/62-Faber-Finds-generative-book-covers.html
相框上的装饰真是太棒了!
答案1
第一次使用 MetaPost 进行粗略的尝试。它并不复杂,因为我们使用的参数较少,而且我们的框架实际上是平方的,但在我看来,提议还不错。请注意,由于结果实际上是随机的,它们看起来可能有点混乱。
\documentclass{standalone}
\usepackage{xcolor}
\usepackage[shellescape,latex]{gmp}
\newcommand{\lowbudgetart}[4]{%
\begin{mpost}[name=lowbudgetart]
vardef LowBudgetArt(expr Iter, Unit, Chaos) =
save Primordia; path Primordia[];
%We can add more paths
Primordia[1] :=
origin .. (0,1) .. (1,0) .. (2,1) .. (3,1)
.. (3,0) .. (2.25,0) .. (2.25,0.5);
Primordia[2] :=
origin .. (0,2) .. (1,2.25) .. (2.5,0.25) .. (2.5,1);
Primordia[3] :=
origin .. (1,-1) .. (2,-1) .. (2.5, -0.5) .. (2,0);
Primordia[4] :=
origin .. controls (1.4,-0.5) and (1.99,0) .. (2,2);
Primordia[5] := origin .. (3,0) .. (3,1) .. (2.9,1)
.. (2.9,-0.2) .. (1,-0.5) .. (0.2,-1);
for i = 1 upto 5:
Primordia[i] := (Primordia[i] shifted -center Primordia[i]) scaled (Unit*uniformdeviate(1+Chaos));
endfor;
save Result; picture Result;
Result := image(
for g = 1 upto Iter:
for i = 1 upto 5:
draw image(
draw Primordia[i];
%I like squared tips. Remove if unwanted.
if uniformdeviate(1)<0.5:
drawdot (point 0 of Primordia[i]) withpen pensquare
scaled 5;
fi
if uniformdeviate(1)>0.5:
drawdot (point infinity of Primordia[i]) withpen currentpen
scaled 10;
fi
)
rotated (uniformdeviate(1)*360)
shifted
if uniformdeviate(1) < 0.5:
(6Unit*(up+right*(uniformdeviate(1))))
else:
(6Unit*(right+up*(uniformdeviate(1))))
fi
;
endfor
endfor
);
draw Result ;
draw Result reflectedabout(up,down);
draw Result reflectedabout(left,right);
draw (Result reflectedabout(up,down))
reflectedabout (left,right);
enddef;
drawoptions(withcolor (0,0,0.5));
LowBudgetArt(#1, \mpdim{#2}, #3);
drawoptions();
label(\btex #4 etex, origin);
\end{mpost}%
\usempost{lowbudgetart}%
}
\begin{document}
%#1=no of iterations
%#2=unit size
%#3=randomization (from zero to one)
%#4=text
\lowbudgetart{6}{5mm}{0.1}{\Large\textbf{Con\TeX t rules}}%
\lowbudgetart{8}{8mm}{0.1}{\Huge\textbf{Ducks in S. Korea}}%
\lowbudgetart{9}{1cm}{0.1}{\Huge\textbf{Peruvian cajón}}%
\end{document}