# Removing borders only from the shared area of intersected shapes

I need to intersect two circles and have the borders around them except the borders inside the shared area. It is the tikz code I am trying to write, I have removed all borders but have no idea how to make the borders around the whole shape now.

\documentclass{article}
\usepackage{tikz}
\begin{document}

% Definition of circles
\def\firstcircle{(10,0) circle (1.5cm)}
\def\secondcircle{(0:11cm) circle (1.5cm)}

\colorlet{circle area}{blue!20}

\tikzset{filled/.style={fill=circle area, draw=none} }

\begin{tikzpicture}

\draw[filled] \firstcircle node {$A$}
\secondcircle node {$B$};
\end{tikzpicture}
\end{document}


• Welcome! This has come up before. See, for example Q71548 (and those that are linked there). You will have to draw those arcs yourself. You can either calculate them (you know the radii and the distance between your circles) or let TikZ calculate them. Commented Apr 11, 2023 at 17:09
• tex.stackexchange.com/a/660943/15036 looks like an exact duplicate. Commented Apr 11, 2023 at 17:21
• tex.stackexchange.com/q/660933/47927 also looks like a duplicate. Commented Apr 11, 2023 at 17:27

It has already been pointed out that the simplest solution may be to compute the relevant angle, which is obviously given by the acos of the ratio between half the distance and the radius, and then draw arcs. And one can conveniently use spath3, see https://tex.stackexchange.com/a/660922/294623. There is yet another option which can be used if you have less analytic control: clips.

\documentclass{article}
\usepackage{tikz}
\begin{document}

% Definition of circles

\colorlet{circle area}{blue!20}

\tikzset{filled/.style={fill=circle area, draw=none} }

analytic

\begin{tikzpicture}
\draw[filled] \firstcircle node {$A$}
\secondcircle node {$B$};
\pgfmathsetmacro{\myalpha}{acos(0.5/1.5)}
\draw[radius=1.5] (10,0) + (\myalpha:1.5) arc[start angle=180-\myalpha,end angle=-180+\myalpha]
arc[start angle=-\myalpha,end angle=-360+\myalpha];
\end{tikzpicture}

clip

\begin{tikzpicture}
\draw[filled] \firstcircle node {$A$}
\secondcircle node {$B$};
\scoped{\clip[overlay](10.5,-2) rectangle (8,2);
\draw\firstcircle;}
\scoped{\clip[overlay](10.5,-2) rectangle (15,2);
\draw\secondcircle;}
\end{tikzpicture}

\end{document}