6

I have six arcs:

\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{figure}[htbp]
\centering
\begin{tikzpicture}[scale=0.3]
\tkzDefPoint(0,0){a}
\tkzDefPoint(12,0){b}
\tkzDefPoint(4,10){c}

\tkzInterCC[R](a,6cm)(b,8cm) \tkzGetFirstPoint{AB1} \tkzGetSecondPoint{AB2}
\tkzInterCC[R](a,6cm)(c,6cm) \tkzGetFirstPoint{AC1} \tkzGetSecondPoint{AC2}
\tkzInterCC[R](b,8cm)(c,6cm) \tkzGetFirstPoint{BC1} \tkzGetSecondPoint{BC2}

\tkzDrawArc(a,AB2)(AB1)
\tkzDrawArc(b,AB1)(AB2)

\tkzDrawArc(a,AC2)(AC1)
\tkzDrawArc(c,AC1)(AC2)

\tkzDrawArc(b,BC2)(BC1)
\tkzDrawArc(c,BC1)(BC2)
\end{tikzpicture}
\end{figure}
\end{document}

I want to fill the three lenses formed by these arcs.

If I use \tkzFillSector, it fills the sector of the circle completely:

enter image description here

What I want is this:

enter image description here

What is the easiest way to fill inside this lens?

  • You could use clip and please post an MWE. – marmot Mar 27 '18 at 18:49
  • +1 for the MWE! I just checked, you an simply append the scopes from my code and the shadings are done correctly. – marmot Mar 28 '18 at 0:51
  • @marmot That is exactly what I've done. Works like a charm :) Thanks again. – padawan Mar 28 '18 at 1:15
7

This seems to be a lot of effort for this output. You only need plain TikZ for that.

\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\coordinate (a) at (0,0);
\coordinate (b) at (12,0);
\coordinate (c) at (4,10);
\begin{scope}
\clip (a) circle (6cm);
\fill[blue!40!white] (b) circle (8cm);
\end{scope}
\begin{scope}
\clip (c) circle (6cm);
\fill[blue!40!white] (b) circle (8cm);
\end{scope}
\begin{scope}
\clip (c) circle (6cm);
\fill[blue!40!white] (a) circle (6cm);
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

And this is a possible way to compute the intersections.

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\coordinate (a) at (0,0);
\coordinate (b) at (12,0);
\coordinate (c) at (4,10);
\begin{scope}
\clip[name path global=CircleA] (a) circle (6cm);
\fill[name path global=CircleB,blue!40!white] (b) circle (8cm);
\end{scope}
\begin{scope}
\clip[name path global=CircleC] (c) circle (6cm);
\fill[blue!40!white] (b) circle (8cm);
\end{scope}
\begin{scope}
\clip (c) circle (6cm);
\fill[blue!40!white] (a) circle (6cm);
\end{scope}
\path[name intersections={of=CircleA and CircleB, name=AB}];
\fill (AB-1) circle (1pt);\fill (AB-2) circle (1pt);
\path[name intersections={of=CircleA and CircleC, name=AC}];
\fill (AC-1) circle (1pt);\fill (AC-2) circle (1pt);
\path[name intersections={of=CircleB and CircleC, name=BC}];
\fill (BC-1) circle (1pt);\fill (BC-2) circle (1pt);
\end{tikzpicture}
\end{document}
  • That is a great answer and just what I was looking for! Thanks! – padawan Mar 27 '18 at 20:09
  • Can I somehow determine the intersection points of circles? – padawan Mar 27 '18 at 20:19
  • @padawan Yes. With the intersection library. BTW, I have not tried, but quite likely you only need to append the three scopes from my answer to your code to do the filling. (I could not check because you did not provide an [MWE].) – marmot Mar 27 '18 at 20:21
4

You can use the same code with tkz-euclide

\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{figure}\[htbp\]
\centering
\begin{tikzpicture}\[scale=0.3\]
\tkzDefPoint(0,0){a}
\tkzDefPoint(12,0){b}
\tkzDefPoint(4,10){c}

\tkzInterCC\[R\](a,6cm)(b,8cm) \tkzGetFirstPoint{AB1} \tkzGetSecondPoint{AB2}
\tkzInterCC\[R\](a,6cm)(c,6cm) \tkzGetFirstPoint{AC1} \tkzGetSecondPoint{AC2}
\tkzInterCC\[R\](b,8cm)(c,6cm) \tkzGetFirstPoint{BC1} \tkzGetSecondPoint{BC2}

\tkzDrawArc(a,AB2)(AB1)
\tkzDrawArc(b,AB1)(AB2)

\tkzDrawArc(a,AC2)(AC1)
\tkzDrawArc(c,AC1)(AC2)

\tkzDrawArc(b,BC2)(BC1)
\tkzDrawArc(c,BC1)(BC2)

\begin{scope}
\tkzClipSector(b,BC2)(BC1)
\tkzFillSector\[blue!40!white\](c,BC1)(BC2)
\end{scope}

\begin{scope}
\tkzClipSector(a,AB2)(AB1)
\tkzFillSector\[blue!40!white\](b,AB1)(AB2)
\end{scope}

\begin{scope}
\tkzClipSector(a,AC2)(AC1)
\tkzFillSector\[blue!40!white\](c,AC1)(AC2)
\end{scope}

\end{tikzpicture}
\end{figure}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.