我忍不住觉得我们需要在 TeX.SX 上举办更多有趣的编码竞赛,因为这些竞赛在过去似乎表现不错(例如特克斯,土拨鼠日)我想尝试自己组装一个。也许这甚至可以成为一种常规做法?
竞赛
如果你选择接受你的使命,那就是创建一个曼陀罗只使用 TeX。设计完全由您决定 - 任何您喜欢的主题(如果有的话),简单或复杂,都可以,可以是彩色或单色。要查看我所说的曼陀罗的示例,请单击这里。
规则
- 参赛作品必须仅使用 TeX 及其衍生语言、包等。禁止使用外部图形(但像
tikzlings
和这样的东西tikzsymbols
可以)。 - 发布图像和代码,以便我们能看到您做了什么。
- 您可以随意输入多次。
- 比赛于 2019 年 7 月 12 日格林威治标准时间晚上 11:59 结束。
- 比赛结束时获得最多赞同票的有效参赛作品即为获胜者。
- 玩得开心! :)
奖品
- 吹牛的权利。
- 可选:您可以主持本系列的下一场 TeX 编码竞赛。
- 还有什么吗?有什么建议吗?
我期待看到你们所有富有创意的作品!:)
获奖者
恭喜@Mark Wibrow 创作的曼陀罗非常聪明、漂亮,它获得了最多的选票,是当之无愧的赢家。您不仅获得了赏金,还被选为最佳答案。如果您愿意,您也可以自己组织一场有趣的比赛,或者选择某人代替您承担这一荣誉。
感谢所有提交参赛作品的人。我很高兴看到你们所有富有创意、独特的设计和巧妙的代码。对于那些想尝试但无法及时提交参赛作品的人,请随时提交参赛作品。这只是为了好玩,不是为了赢,但我总是很想看看你们能想出什么精彩的东西。
祝你编码愉快!
答案1
一个巨大的消逝……
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{fadings}
\begin{tikzfadingfrompicture}[name=mandela]
\tikzset{%
filled/.style={%
fill=pgftransparent,
draw=pgftransparent!0,
},
line join=round,
doubled/.style={
double=pgftransparent,
double distance=#1,
},
doubled/.default=1.5}
\foreach \i in {0,2,...,15}{
\tikzset{shift=(360/16*\i:4)}
\foreach \j in {0,...,19}
\path[filled,doubled] (360/19*\j:1) circle [radius=1/6];
\path [filled,doubled] circle [radius=1];
\foreach \j in {0,...,23}
\path[filled,doubled] (360/24*\j:6/8) circle [radius=1/16];
}
\foreach \i in {1,3,...,15}{
\tikzset{shift=(360/16*\i:3), rotate=360/16*\i+90, scale=-1}
\path [discard] (1,0) arc (315:450:1/2) arc (315:450:1/3) arc (315:360:1/4)
coordinate (a);
\path [filled, doubled]
(-1,0) arc (225:90:1/2) arc (225:90:1/3) arc (225:180:1/4)
.. controls ++(90:1/4) and ++(260:1/4) ..(0,5/2)
.. controls ++(280:1/4) and ++(90:1/4) .. (a)
arc (360:315:1/4) arc (450:315:1/3) arc(450:315:1/2);
\foreach \j in {0,1,-1,2,-2,3,-3}
\path [filled, doubled, shift=(270:1/3),rotate=90+10*\j]
(0,0) .. controls ++(1/8,0) and ++(-1/8,0) .. ({1.5-abs(\j/3)},-1/8)
arc (270:450:1/8) -- cycle;
}
\foreach \i in {0,1}{
\foreach \j [evaluate={\k=360/8*(\i+\j);}] in {0,2,...,7}{
\tikzset{shift=(\k:2), rotate=\k+90, scale=-1}
\path [discard] (1,0) arc (315:450:1/2) arc (315:360:1/3)
coordinate (a);
\path [filled, doubled]
(-1,0) arc (225:90:1/2) arc (225:180:1/3)
.. controls ++(90:1/4) and ++(260:1/4) ..(0,9/4)
.. controls ++(280:1/4) and ++(90:1/4) .. (a)
arc (360:315:1/3) arc(450:315:1/2);
\foreach \k in {0,1,-1}
\path [filled, doubled, rotate=90+10*\k]
(1/2,0) .. controls ++(1/8,0) and ++(-1/8,0) .. ({1.5-abs(\k/3)},-1/8)
arc (270:450:1/8) -- cycle;
}
}
\foreach \i in {0,2,...,15}{
\tikzset{shift=(360/16*\i:2)}
\foreach \j in {0,...,19}
\path [filled,doubled] (360/19*\j:3/4) circle [radius=1/8];
\path [filled,doubled] circle [radius=3/4];
\path [filled,doubled] circle [radius=1/2];
\path [filled,doubled] circle [radius=1/4];
}
\path [filled, doubled] circle [radius=9/4];
\foreach \i in {0,2,...,31}
\path[filled,doubled] (360/32*\i:6/4) circle [radius=1/3];
\foreach \i in {0,1}{
\foreach \j [evaluate={\k=360/16*(\i+\j);}] in {0,2,...,15}{
\tikzset{shift=(\k:1), rotate=\k+90, scale=-1}
\path [filled, doubled]
(-1/4, 0)
.. controls ++(135:1/2) and ++(260:1/2) .. (0,7/8)
.. controls ++(280:1/2) and ++(45:1/2) .. (1/4,0);
\path [filled, doubled]
(0,0) .. controls ++(135:1/8) and ++(270:1/8) ..
(-1/8,1/3) arc (180:0:1/8) .. controls ++(270:1/8) and ++(45:1/8) .. cycle;
}
}
\path [filled, doubled] circle [radius=5/4];
\foreach \i in {0,1}
\foreach \j in {0,1,...,11}
\path [filled, doubled, rotate=90+30*\j+\i*15]
(0,0) .. controls ++(1/8,0) and ++(-1/8,0) .. (7/8,-1/8)
arc (270:450:1/8) -- cycle;
\path [filled, doubled] circle [radius=3/4];
\foreach \i in {0,1}{
\foreach \j [evaluate={\k=360/6*(\i+\j);}] in {0,2,...,5}{
\tikzset{shift=(\k:1/4), rotate=\k+90, scale=-1}
\path [filled, doubled]
(-1/8, 0)
.. controls ++(135:1/8) and ++(250:1/8) .. (0,1/4)
.. controls ++(290:1/8) and ++(45:1/8) .. (1/8,0);
}
}
\path [filled, doubled] circle [radius=1/4];
\end{tikzfadingfrompicture}
\pgfdeclareradialshading{mandela}{\pgfpointorigin}{%
color(0cm)=(yellow);
color(0.2cm)=(red);
color(0.4cm)=(purple);
color(0.6cm)=(blue);
color(0.8cm)=(cyan);
color(1cm)=(cyan)}
\begin{document}
\begin{tikzpicture}
\shade [shading=mandela, path fading=mandela, fit fading=false]
(-6,-6) rectangle (6,6);
\end{tikzpicture}
\end{document}
答案2
这是一份为了开始聚会而快速撰写的提案。
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[pics/leaf/.style={code={
\pgfgettransformentries{\myxx}{\myxy}{\myyx}{\myyy}{\tmp}{\tmp}
\pgfmathsetmacro{\myscale}{sqrt(\myxx*\myyy-\myxy*\myyx)}
\draw[line width=\myscale*1pt,pic actions] (-0.1,0) to[out=80,in=-80] (0,0.5)
to[out=100,in=-90] (-0.5,1) to[out=90,in=-80] (-0.03,2) -- (0,2)
to[out=-80,in=90] (0.5,1) to[out=-90,in=80] (0.1,0.5)
to[out=-100,in=95] (0.1,0) -- cycle;}}]
\path foreach \Radius [count=\Cnt] in {4,2,1,0.5}
{foreach \Angle [evaluate=\Angle as \EffAngle using {\Angle-15*\Cnt}]
in {0,30,...,330} { (\EffAngle:\Radius)
pic[rotate=\EffAngle-90,scale=\Radius,fill=white]{leaf}}};
\end{tikzpicture}
\end{document}
或者应小土拨鼠的特殊要求。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{shadings}
\begin{document}
\begin{tikzpicture}[pics/leaf/.style={code={
\pgfgettransformentries{\myxx}{\myxy}{\myyx}{\myyy}{\tmp}{\tmp}
\pgfmathsetmacro{\myscale}{sqrt(\myxx*\myyy-\myxy*\myyx)}
\begin{scope}[line width=\myscale*1pt]
\draw[clip] (-0.1,0) to[out=80,in=-80] (0,0.5)
to[out=100,in=-90] (-0.5,1) to[out=90,in=-80] (-0.03,2) -- (0,2)
to[out=-80,in=90] (0.5,1) to[out=-90,in=80] (0.1,0.5)
to[out=-100,in=95] (0.1,0) -- cycle;
\shade[shading=color wheel] (O) circle[radius=12cm];
\end{scope}}}]
\path (0,0) coordinate (O);
\path foreach \Radius [count=\Cnt] in {4,2,1,0.5}
{foreach \Angle [evaluate=\Angle as \EffAngle using {\Angle-15*\Cnt}]
in {0,30,...,330} { (\EffAngle:\Radius)
pic[rotate=\EffAngle-90,scale=\Radius,fill=white]{leaf}}};
\end{tikzpicture}
\end{document}
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{shadings}
\begin{document}
\begin{tikzpicture}[pics/leaf/.style={code={
\pgfgettransformentries{\myxx}{\myxy}{\myyx}{\myyy}{\tmp}{\tmp}
\pgfmathsetmacro{\myscale}{sqrt(\myxx*\myyy-\myxy*\myyx)}
\begin{scope}[line width=\myscale*1pt]
\draw[clip] (-0.1,0) to[out=80,in=-80] (0,0.5)
to[out=100,in=-90] (-0.5,1) to[out=90,in=-80] (-0.03,2) -- (0,2)
to[out=-80,in=90] (0.5,1) to[out=-90,in=80] (0.1,0.5)
to[out=-100,in=95] (0.1,0) -- cycle;
\shade[#1,shading=color wheel] (O) circle[radius=12cm];
\end{scope}}}]
\path (0,0) coordinate (O);
\path foreach \Radius [count=\Cnt] in {4,2,1,0.5}
{foreach \Angle [evaluate=\Angle as \EffAngle using {\Angle-15*\Cnt}]
in {0,30,...,330} { (\EffAngle:\Radius)
pic[rotate=\EffAngle-90,scale=\Radius,fill=white]{leaf={transform canvas={rotate=-pi*\EffAngle}}}}};
\end{tikzpicture}
\end{document}
答案3
这里有一个建议,使用漂亮的结和弹簧菲齐科@sergey-slyusarev 编写的 MetaPost 库。使用 进行编译context
。
\startMPpage[offset=3bp]
\input fiziko;
u:=2cm;
path p[];
p[0] = function(2,"(4+3cos(5x))*cos(x)","(4+3cos(5x))*sin(x)",epsed(0),epsed(2pi),1/50) .. cycle;
p[1] := p[0] scaled u;
p[2] := p[1] rotated 24;
p[3] := p[2] rotated 24;
p[4] := fullcircle scaled 13u;
p[5] := fullcircle scaled 8u;
p[6] := fullcircle scaled 3u;
springwidth:=1/10u;
for i=1 upto 15:
draw spring(origin,(u-1/8cm,0) rotated (24i-12),5) withpen pencircle scaled 0.5;
endfor;
addStrandToKnot (flowerouter) (p1, 1/8cm, "e", "1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1");
addStrandToKnot (flowerouter) (p2, 1/8cm, "e", "1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1");
addStrandToKnot (flowerouter) (p3, 1/8cm, "e", "1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1");
addStrandToKnot (flowerouter) (p4, 1/2cm, "e", "");
addStrandToKnot (flowerouter) (p5, 1/2cm, "e", "");
addStrandToKnot (flowerouter) (p6, 1/2cm, "e", "");
draw knotFromStrands (flowerouter);
\stopMPpage
答案4
根据维基百科曼陀罗(मण्डल)的字面意思是圆圈,其最纯粹的形式是“一个正方形,四个门内有一个圆圈,圆圈的中心点为圆。每个门的形状大致为 T 形”。
这样的东西显然不应该被多余的 bling 和 tikzness 所混淆,而应该使用没有任何包的核心 latex 格式来设置。
\documentclass{article}
\begin{document}
\begin{picture}(40,40)
\put(00,00){\framebox(40,40){}}\put(20,20){\circle{30}}
\put(20,20){\circle*{2}} \linethickness{2pt}
\put(15,01){\line(1,0){10}}\put(20,00){\line(00,01){4}}
\put(15,39){\line(1,0){10}}\put(20,40){\line(00,-1){4}}
\put(01,15){\line(0,1){10}}\put(00,20){\line(01,00){4}}
\put(39,15){\line(0,1){10}}\put(40,20){\line(-1,00){4}}
\end{picture}
\end{document}