40

I can't help but feel we need more fun coding contests here on TeX.SX, and since these seemed to do well in the past (e.g. TeX-mas, Groundhog Day) I thought I'd try my hand at putting together one of my own. Maybe it can even become a regular thing?

The Contest

Your mission, should you choose to accept it, is to create a mandala using nothing but TeX. The design is entirely up to you - any theme you like (if any), as simple or as complex as you like, and it can be coloured or monochrome. For examples of what I mean by mandala, click here.

Rules

  • Entry must be made using nothing but TeX and derived languages, packages, etc. No outside graphics (but things like tikzlings and tikzsymbols are fine).
  • Post both the image and your code, so we can see what you did.
  • You can enter as many times as you like.
  • Contest ends 11:59pm GMT, July 12th, 2019.
  • Winner is whichever valid entry receives the most upvotes by the end of the contest.
  • Have fun! :)

Prizes

  • Bragging rights.
  • Optional: You get to host the next TeX coding contest in this series.
  • Something else? Suggestions?

I look forward to seeing all your creative entries! :)

Winners

Congratulations to @Mark Wibrow for his very clever and beautiful mandala, which was the clear winner after receiving the most votes by far. You have received the bounty, as well as being selected as the chosen answer. If you like, you can also put together a fun contest of your own, or perhaps choose someone to take on the honour instead.

Thank you everyone who submitted an entry to this contest. I loved seeing all your creative and unique designs and clever code. For anyone who wanted to have a go at this but were unable to get an entry in in time, please feel free to submit one anyway, whenever you like. It'll just be for fun, not to win, but I'll always be keen to see what wonderful things you guys can come up with.

Happy coding!

15
  • 1
    Last time I put a fun question in Meta I had to remove it because it didn't fit in the scope of Meta (and the negative responses back then made me remove it instead of moving it to the main site). Meta is for questions about the main site, not for any coding things. This should be moved to main, imho.
    – Skillmon
    Commented Jun 13, 2019 at 11:29
  • 2
    Is there something about this question that makes it significantly different to TeX-mas or Groundhog Day, such that it is appropriate for them to be hosted here, but not this? Or a policy change since they were posted? Looking at it another way, if this were moved to the main site, would people be ok with a contest there, where the question is very open ended, and the answer may be subjective, especially if I chose to add a bounty as a prize, or would it be considered inappropriate? I can see points both for and against each side of this debate.
    – Ulysses
    Commented Jun 14, 2019 at 7:31
  • 2
    Considering this debate is a bit more general than just in reference to the question at hand, it might be better to create a separate question on meta, asking whether contests like this would be best posted on meta or the main site, and whether there are any dos and don'ts for how the question should be asked. I feel like this debate might get a bit lost if it remains in the comments on this question, and it could really benefit from having a few more experts weigh in. I'd be happy to use the consensus of that new question to determine whether this question should be moved or not.
    – Ulysses
    Commented Jun 14, 2019 at 7:38
  • 2
    In my opinion, it is just a matter of how and where we want to see a question being posted (I am pretty sure most of us don't care about reputation). Since there is a fun tag specifically available here, I think this question is still valid in our meta. Moreover, for these class of questions, we can leave it to the author to decide where they want to post it. Nevertheless, I do see the point that we don't want to post codes in the meta, but, since these questions are for fun does it matter that much? Commented Jun 14, 2019 at 11:58
  • 2
    Suppose if we all (I mean the majority) agree that the fun posts (that requires coding) are not allowed in our meta, we must make an explicit definition for the fun tag. Commented Jun 14, 2019 at 12:01

6 Answers 6

55
+150

One colossal fading...

\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}

enter image description here

3
  • Very nice and my compliments.
    – Sebastiano
    Commented Jun 19, 2019 at 12:04
  • 2
    Absolutely gorgeous! Thanks for your entry. :)
    – Ulysses
    Commented Jun 19, 2019 at 12:47
  • Congratulations on winning this contest! It was very well deserved.
    – Ulysses
    Commented Jul 13, 2019 at 18:10
41

This is a very quickly written proposal to get the party started.

\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}

enter image description here

Or at the special request of a small marmot.

\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}

enter image description here

\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}

enter image description here

3
  • Looks great, marmot! Like a chrysanthemum. Thanks for your entry. :)
    – Ulysses
    Commented Jun 13, 2019 at 6:54
  • The colors really got me to stop. Commented Jun 21, 2019 at 2:00
  • 1
    @KeithPrussing Well, this assumes that you cannot see UV nor IR frequencies. ;-)
    – user121799
    Commented Jun 21, 2019 at 2:01
40

Here is a suggestion, using knots and springs from the nice fiziko library for MetaPost by @sergey-slyusarev. Compile with 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

The mandala showing

2
  • 1
    This is really pretty! I like it a lot. :D Thanks for your entry.
    – Ulysses
    Commented Jun 18, 2019 at 6:21
  • 3
    @Ulysses For my bounty, I was very undecided between this answer and Mark's one. Please consider that this one is non-tikz, I warmly recommend it for your bounty or your acceptance :)
    – CarLaTeX
    Commented Jul 8, 2019 at 13:10
28

Q&D L3 implementation to create mandalas from single objects:

% the mandala won't take more space than a `.', so we have to choose big borders
\documentclass[border=10cm]{standalone}

\usepackage{ducksay} % loads xparse
\ExplSyntaxOn
\NewDocumentCommand \MandalaNewObject { o m +m }
  {
    \coffin_if_exist:cF { g__mandala_ #2 _coffin }
      { \coffin_new:c { g__mandala_ #2 _coffin } }
    \IfNoValueTF { #1 }
      { \hcoffin_gset:cn { g__mandala_ #2 _coffin } }
      { \vcoffin_gset:cnn { g__mandala_ #2 _coffin } { #1 } }
      { #3 }
    \ignorespaces
  }
\coffin_new:N \l__mandala_tmpa_coffin
\coffin_new:N \g__mandala_output_coffin
\hcoffin_gset:Nn \g__mandala_output_coffin { . }
\fp_new:N \l__mandala_angle_fp
\dim_new:N \l__mandala_x_dim
\dim_new:N \l__mandala_y_dim
\NewDocumentCommand \MandalaPlaceObject { m m o m s O{0} m }
  {
    % #1 object name
    % #2 scale
    % #3 rotation of individual objects
    % #4 radius
    % #5 offset rotation in opposite direction
    % #6 degrees offset
    % #7 count
    \coffin_set_eq:Nc \l__mandala_tmpa_coffin { g__mandala_ #1 _coffin }
    \coffin_scale:Nnn \l__mandala_tmpa_coffin { #2 } { #2 }
    \IfValueT { #3 } { \coffin_rotate:Nn \l__mandala_tmpa_coffin { #3 } }
    \IfBooleanTF { #5 }
      { \coffin_rotate:Nn \l__mandala_tmpa_coffin { #6 } }
      { \coffin_rotate:Nn \l__mandala_tmpa_coffin { -1 * ( #6 ) } }
    \fp_set:Nn \l__mandala_angle_fp { 360 / #7 }
    \int_step_inline:nn { #7 }
      {
        \dim_set:Nn \l__mandala_x_dim
          {
            \fp_eval:n
              { ( #4 ) * sind ( ( ##1 - 1 ) * \l__mandala_angle_fp + ( #6 ) ) }
            pt
          }
        \dim_set:Nn \l__mandala_y_dim
          {
            \fp_eval:n
              { ( #4 ) * cosd ( ( ##1 - 1 ) * \l__mandala_angle_fp + ( #6 ) ) }
            pt
          }
        \coffin_attach:NnnNnnnn
          \g__mandala_output_coffin { hc } { vc }
          \l__mandala_tmpa_coffin   { hc } { vc }
          { \l__mandala_x_dim } { \l__mandala_y_dim }
        \coffin_rotate:Nn \l__mandala_tmpa_coffin { -\l__mandala_angle_fp }
      }
    \ignorespaces
  }
\NewDocumentCommand \MandalaOutput {}
  {
    \coffin_typeset:Nnnnn \g__mandala_output_coffin { l } { b } { 0pt } { 0pt }
  }
\ExplSyntaxOff

\DucksayOptions{vpad=1}

\begin{document}
\MandalaNewObject{duck}{\ducksay{This is a mandala}}
\MandalaNewObject{dog}{\ducksay[dog]{Woof}}
\MandalaNewObject{crusader}{\ducksay[crusader]{deus vult!}}
\MandalaNewObject{small-duck}{\ducksay[small-duck]{Quack}}
\MandalaNewObject{LaTeX}{\LaTeX}
\MandalaNewObject{texsx}{TeX.SX}
\MandalaPlaceObject{duck}{1}[22.5]{7cm}{8}
\MandalaPlaceObject{dog}{.5}{3cm}{8}
\MandalaPlaceObject{crusader}{.7}{7cm}*[-22.5]{8}
\MandalaPlaceObject{small-duck}{.3}{1cm}{8}
\MandalaPlaceObject{LaTeX}{.7}[45]{2cm}[11.25]{8}
\MandalaPlaceObject{LaTeX}{.7}[-45]{2cm}[-11.25]{8}
\MandalaPlaceObject{texsx}{1}{5cm}[22.5]{8}
\MandalaOutput
\end{document}

enter image description here

2
  • 5
    A very unique mandala! Thanks for your entry. :)
    – Ulysses
    Commented Jun 13, 2019 at 16:31
  • 6
    Thanks anonymous down voter. Do you want to tell why you down voted this?
    – Skillmon
    Commented Jun 17, 2019 at 8:14
25

According to wikipedia Mandala (मण्डल) literally means circle, and in its purest form is "a square with four gates containing a circle with a center point. Each gate is in the general shape of a T".

Such a thing clearly should not be obfuscated with extraneous bling and tikzness, and should be set using the core latex format with no packages.

enter image description here

\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}
3
  • 2
    (+1) I have been here for a relatively short time, but I get a feeling that this answer is not by you. It is you. :)
    – mickep
    Commented Jun 19, 2019 at 10:29
  • Definitely a unique take on the mandala. Thanks for your entry. :)
    – Ulysses
    Commented Jun 19, 2019 at 12:48
  • 1
    This looks suspiciously like a Unown from the Pokémon universse... :) Commented Jul 13, 2019 at 19:27
24

The question was How to draw the "sri-cakra" (sri-yantra") using Tikz?. I'm not sure if a "sri-cakra" could be considered as a mandala but in case it could. Here you have my answer there:

\documentclass[tikz,border=2mm]{standalone}

\usetikzlibrary{positioning, shapes.geometric, intersections,calc, backgrounds}

\begin{document}

\pgfdeclarelayer{minus1}
\pgfdeclarelayer{minus2}
\pgfdeclarelayer{minus3}
\pgfsetlayers{minus3,minus2,minus1,background,main}

\begin{tikzpicture}

%step-1
\draw[name path=circ, thick, fill=red!30] (0,0) circle (2.5cm);
\node[regular polygon, regular polygon sides=12, minimum size=5cm, shape border rotate=15] (p) {};

%\node [above] at (p.corner 1) {1};
%\node [above left] at (p.corner 2) {2};
\coordinate (1a) at (p.corner 7);

\path[name path=1--4] (p.corner 1)--(p.corner 4);
\path[name path=1--10] (p.corner 1)--(p.corner 10);
\path[name path=7--11] (p.corner 7)--(p.corner 11);
\path[name path=7--3] (p.corner 7)--(p.corner 3);

\path[name intersections={of=1--4 and 7--3, by=aux1}];
\path[name intersections={of=1--10 and 7--11, by=aux2}];

\path[name path=aux1--aux2] ([xshift=-2cm]aux1)--([xshift=2cm]aux2);

\path[name intersections={of=aux1--aux2 and circ, by={1b,1c}}];

\draw[thick, name path=tri1](1a)--(1b)-- coordinate[midway](5a) (1c)--cycle;

%step-2
\coordinate (2a) at (p.corner 1);

\path[name path=1--9] (p.corner 1)--(p.corner 9);
\path[name path=1--5] (p.corner 1)--(p.corner 5);
\path[name path=7--10] (p.corner 7)--(p.corner 10);
\path[name path=7--4] (p.corner 7)--(p.corner 4);

\path[name intersections={of=1--5 and 7--4, by=aux1}];
\path[name intersections={of=1--9 and 7--10, by=aux2}];

\path[name path=aux1--aux2] ([xshift=-2cm]aux1)--([xshift=2cm]aux2);

\path[name intersections={of=aux1--aux2 and circ, by={2b,2c}}];

\draw[thick, name path=tri2](2a)--(2b)--coordinate[midway](9a) (2c)--cycle;

%steps-3 and 4

\coordinate (S1) at (135:2.5cm);
\coordinate (S2) at (45:2.5cm);
\coordinate (S3) at (-45:2.5cm);
\coordinate (S4) at (-135:2.5cm);

\path[name path=rect] (S1)-- coordinate[midway](4a) (S2) -- (S3)--coordinate[midway](3a) (S4)--cycle; 

\path [name intersections={of=tri1 and tri2, by={*4,x,*1,*2,x,*3}}];

\path [name path=3a--*1] (3a)--($(3a)!1.5!(*1)$);
\path [name intersections={of=rect and 3a--*1, by={x,3b}}];

\path [name path=3a--*2] (3a)--($(3a)!1.5!(*2)$);
\path [name intersections={of=rect and 3a--*2, by={3c}}];

\draw[name path=tri3,thick] (3a)--(3b)--coordinate[midway](6a) (3c)--cycle;

\path [name path=4a--*3] (4a)--($(4a)!1.5!(*3)$);
\path [name intersections={of=rect and 4a--*3, by={x,4b}}];

\path [name path=4a--*4] (4a)--($(4a)!1.5!(*4)$);
\path [name intersections={of=rect and 4a--*4, by={x,4c}}];

\draw[name path=tri4,thick] (4a)--(4b)--coordinate[midway](8a)(4c)--cycle;

%Step-5
\path [name intersections={of=tri3 and tri2, by={x,*5,x,x,*6,x}}];

\path [name intersections={of=tri1 and tri4, by={*8,x,x,x,x,*7}}];

\path [name path=5a--*7] (5a)--($(5a)!1.5!(*7)$);
\path [name intersections={of=rect and 5a--*7, by=5b}];

\path [name path=5a--*8] (5a)--($(5a)!1.5!(*8)$);
\path [name intersections={of=rect and 5a--*8, by=5c}];

\draw[name path=tri5,thick] (5a)--(5b)--(5c)--cycle;

%%Step-6
\path [name path=*1--*4] (*1)--(*4);
\path [name path=*2--*3] (*2)--(*3);

\path  [name intersections={of=tri3 and *1--*4, by=6c}];
\path  [name intersections={of=tri3 and *2--*3, by={6b,x}}];

\draw[name path=tri6,thick] (6a)--(6b)-- coordinate[midway](7a) (6c)--cycle;

%Step-7

\path [name intersections={of=tri2 and tri3, by={x,*1,x,x,*3,x}}];
\path [name intersections={of=tri1 and tri4, by={x,x,*2,*4,x,x}}];

\path [name path=*1--*2] (7a)--($(7a)!1.5!(*1)$);
\path [name intersections={of=rect and *1--*2, by=7b}];

\path [name path=*3--*4] (7a)--($(7a)!1.5!(*3)$);
\path [name intersections={of=rect and *3--*4, by=7c}];

\draw[name path=tri7,thick] (7a)--(7b)-- (7c)--cycle;

%Step-8

\path [name intersections={of=tri6 and tri7, by={*1,x,*2}}];
\path [name path=*1--*2] ($(*2)!1.5!(*1)$)--($(*1)!1.5!(*2)$);
\path [name intersections={of=tri4 and *1--*2, by={8b,8c}}];

\draw[name path=tri8,thick] (8a)--(8b)-- (8c)--cycle;

%Step-9

\path [name intersections={of=tri5 and tri7, by={*1,*2}}];
\path [name path=*1--*2] ($(*2)!2.5!(*1)$)--($(*1)!2.5!(*2)$);
\path [name intersections={of=tri6 and *1--*2, by={9b,9c}}];

\draw[name path=tri9,thick] (9a)--(9b)-- (9c)--cycle;

\fill[blue!30, even odd rule] (1a)--(1b)--(1c)--cycle (2a)--(2b)--(2c)--cycle (3a)--(3b)--(3c)--cycle (4a)--(4b)--(4c)--cycle (5a)--(5b)--(5c)--cycle (6a)--(6b)--(6c)--cycle (7a)--(7b)--(7c)--cycle (8a)--(8b)--(8c)--cycle (9a)--(9b)--(9c)--cycle;

%Step-10

\draw[fill=red!30] (barycentric cs:*1=1,*2=1,9a=1) circle (2pt);

%Step-11

\begin{scope}[on background layer]
\draw [fill=green] circle (3cm);

\foreach \i [evaluate=\i as \start using 22.5+45*\i] in {0,...,7}
    \draw[fill=blue!30] (\start:2.5) to[out=10, in=170, relative] ({\start-22.5}:3) to [out=10, in=170, relative] ({\start-45}:2.5) arc [start angle={\start-45}, delta angle=45, radius=2.5cm]--cycle;
\end{scope}

%Step-12

\begin{pgfonlayer}{minus1}
\draw [fill=red] circle (3.5cm);

\foreach \i [evaluate=\i as \start using 11.25+22.5*\i] in {0,...,15}
    \draw[fill=blue!30] (\start:3) to[out=10, in=170, relative] ({\start-11.25}:3.5) to [out=10, in=170, relative] ({\start-22.5}:3) arc [start angle={\start-11.25}, delta angle=22.5, radius=3.5cm]--cycle;
\end{pgfonlayer}

%Step-13

\begin{pgfonlayer}{minus2}
\draw [fill=blue!39] circle (4cm);
\draw [line width=2mm, blue!70!black] circle (3.75cm);
\end{pgfonlayer}

%Step-14

\begin{pgfonlayer}{minus3}
\node [fill=yellow, minimum size=8.25cm] (b) {}; 
\node [fill=yellow, minimum width=9.5cm, minimum height=3cm] (bh) {}; 
\node [fill=yellow, minimum height=9.5cm, minimum width=3cm] (bv) {}; 
\node [fill=yellow, minimum height=8mm, minimum width=6cm] at (bv.north) (bn) {}; 
\node [fill=yellow, minimum height=8mm, minimum width=6cm] at (bv.south) (bs) {}; 
\node [fill=yellow, minimum width=8mm, minimum height=6cm] at (bh.west) (bw) {}; 
\node [fill=yellow, minimum width=8mm, minimum height=6cm] at (bh.east) (be) {}; 
\draw [brown!60!black,line width=1mm]% 
(be.south west)-|(be.north east)-|(bh.north-|be.west)-|(b.north east)-|(bv.east|-bn.south)-|(bn.north east)-|(bn.south west)-|(b.north-|bv.west)-|(b.west|-bh.north)-|(bw.north east)-|(bw.south west)-|(bw.east|-bh.south)-|(b.south west)-|(bv.west|-bs.north)-|(bs.south west)-|(bs.north east)-|(bv.east|-b.south)-|(b.east|-bh.south)-|cycle;

\end{pgfonlayer}

\end{tikzpicture}

\end{document}

enter image description here

And with little changes (see https://tex.stackexchange.com/a/271991/1952) to steps 11 and 12 you could get

enter image description here

1
  • Yes, this absolutely counts as a mandala. :) It's a good example of the older kind of mandalas. It even appears as an example on Wikipedia's page on mandalas. Thanks for your entry.
    – Ulysses
    Commented Jun 18, 2019 at 6:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .