TikZ-PGF – How to Fill an Area Defined by Three Nodes in TikZ

filltikz-pgf

Consider this MWE:

\documentclass[tikz, border=10pt]{standalone}
\usetikzlibrary{calc,positioning}

\begin{document}

\begin{tikzpicture}[scale=1,font=\Large]
    \tikzstyle{dag} = [-,thick,draw=blue!50];
    \node[minimum height=0pt, minimum width=0pt] (matha) at (0,0) {};
    \node (gun) [below=1cm of matha] {c};
    \node (a2) [left=1.3cm of gun] {a};
    \node (a1) [left=0.4cm of gun] {b};
    \node (b1) [right=0.4cm of gun] {d};
    \node (b2) [right=1.3cm of gun] {e};
    \draw[draw=blue, fill=blue!50] (a2.north) -- (0,0.37) -- (b2.north) -- cycle;
    \draw[fill=blue!20,dag] (a2.90) to[bend left=35] (0,0.37);
    \draw[fill=white,dag] (a1.90) to[bend left=40] (0,0.37);
    \draw[fill=blue!20,dag] (b2.90) to[bend right=35] (0,0.37);
    \draw[fill=white,dag] (b1.90) to[bend right=40] (0,0.37);
    \draw[fill=white,dag] (a2.north) to[out=60,in=120] (a1.north);
    \draw[fill=white,dag] (a1.north) to[out=60,in=120] (gun.north);
    \draw[fill=white,dag] (gun.north) to[out=60,in=120] (b1.north);
    \draw[dag] (b1.north) to[out=60,in=120] (b2.north);
\end{tikzpicture}

\end{document}

I want to make this, but could not do it. How can I do that?

enter image description here

Best Answer

\documentclass[tikz, border=10pt]{standalone}
\usetikzlibrary{calc,positioning}
\begin{document}
\begin{tikzpicture}[scale=1,font=\Large]
\tikzset{dag/.style = {thick,draw=blue!50}};
\node[minimum height=0pt, minimum width=0pt] (matha) at (0,0) {};
\node (gun) [below=1cm of matha] {c};
\node (a2) [left=1.3cm of gun] {a};
\node (a1) [left=0.4cm of gun] {b};
\node (b1) [right=0.4cm of gun] {d};
\node (b2) [right=1.3cm of gun] {e};
\fill[blue!20] (0,0.37) to[bend right=35] (a2.north) to[out=60,in=120] (a1.north) to[out=100,in=200] cycle (0,0.37) to[bend left=35] (b2.north) to[out=120,in=60] (b1.north) to[out=80,in=-20] cycle;
\draw[dag, miter limit=1] (a2.north) to[out=60,in=120] (a1.north) to[out=60,in=120] (gun.north) to[out=60,in=120] (b1.north) to[out=60,in=120] (b2.north)  to[bend right=35] (0,0.37) to[bend right=35] cycle (a1.north) to[out=100,in=200] (0,0.37) (b1.north) to[out=80,in=-20] (0,0.37);
\end{tikzpicture}
\end{document}

enter image description here