How to connect start and end of two arcs with rounded corners

arctikz-pgf

This is the mwe; Left side is what I want, but how to connect properly on the right side?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
    \draw [help lines] (0,0) grid (4,4);
    \draw[rounded corners, fill=cyan!20] (4,2) arc [start angle=45, end angle=135, radius=2.828] arc [start angle=-131.81, end angle=-48.19, radius=3] -- cycle;
\end{tikzpicture}
\end{document}
 

rendered image

Best Answer

The problem here is that you are trying to round a corner in a path with two points that are very close to each other:

  • The end point of the second arc
  • The cycle point that close your path.

When I compile your code, I abtain an awful glitch:

enter image description here

I suggest here an alternative the solution based on cutting one of the arcs by the middle with an auxiliary path that find the middle point:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{ext.topaths.arcthrough}
\begin{tikzpicture}[x=1cm,y=1cm]
    \draw [help lines] (0,0) grid (4,6);
    \draw[rounded corners, fill=cyan!20] 
    (4,2) arc [start angle=45, end angle=135, radius=2.828] 
    arc [start angle=-131.81, end angle=-48.19, radius=3] -- cycle ;
    
    \begin{scope}[yshift=2cm]
      % Auxiliar path to calculate coordinate (A)
      \path   
      (4,2) 
      arc [start angle=45, end angle=135, radius=2.828] 
      node[pos=0.5, circle, fill=red, inner sep=1pt] (A) {} 
      ;

      \draw[rounded corners, fill=cyan!20] 
      (A) 
      arc [start angle=90, end angle=135, radius=2.828] 
      arc [start angle=-131.81, end angle=-48.19, radius=3] 
      arc [start angle=45, end angle=90, radius=2.828] 
      ;
    \end{scope}

\end{tikzpicture}
\end{document}  

enter image description here