# how to connect start and end of two arcs with rounded corners

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}

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:

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}

• really simpler and better idea; Thanks.
– LL L
Commented Jan 20 at 9:00

With some mathematics... I tried to use useful names for the variables: radius, side of the equilateral triangle (since the initial angle is \asrt=45), and various angles. If it is not clear, let me know.

Remark I updated the code; there are three variables: the radius \r, the initial angle \asrt, and the correcting angle \adif needed to obtain the rounded corners. Note that the rounded corners does not work correctly if \adif=3 for example.

The code

\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, math}
\begin{document}

\begin{tikzpicture}[%
evaluate={%
\r = 2.8;
\asrt = 45;
\aend = 180 -\asrt;
($(0, -\s) +(\asrt +\adif: \r)$)
-- ($(0, \s) +(-\aend +\adif: \r)$)