TikZ Schnittmenge von Formen füllen

Tabellen und Grafiken erstellen und anordnen


uhuwe
Forum-Newbie
Forum-Newbie
Beiträge: 7
Registriert: Fr 19. Jul 2013, 15:48
Wohnort: Wedemark OT-Mellendorf

TikZ Schnittmenge von Formen füllen

Beitrag von uhuwe »

\draw(40mm,100mm) circle (10mm);
\draw(50mm,100mm) circle (10mm);

Wie kann ich die Schnittmenge füllen?

Dankeschön


Bartman
Forum-Meister
Forum-Meister
Beiträge: 2456
Registriert: Do 16. Jul 2009, 21:41
Wohnort: Hessische Provinz

Re: TikZ Schnittmenge von Formen füllen

Beitrag von Bartman »

Eine Möglichkeit wäre der Einsatz von \clip:

\documentclass[tikz, border=2pt]{standalone}
\usetikzlibrary{backgrounds}

\begin{document}
\begin{tikzpicture}[radius=1cm]
\draw
    (4,10) circle coordinate (left circle)
    (5,10) circle coordinate (right circle)
;
\begin{scope}[on background layer]
    \clip (right circle) circle;
    \fill [red] (left circle) circle;
\end{scope}
\end{tikzpicture}
\end{document}

esdd
Forum-Meister
Forum-Meister
Beiträge: 2561
Registriert: So 7. Feb 2010, 16:36

Re: TikZ Schnittmenge von Formen füllen

Beitrag von esdd »

Alternativ kann man auch path picture verwenden:

\documentclass[tikz, border=2pt]{standalone}
\begin{document}
\begin{tikzpicture}[
    second circle/.style={insert path={(5,10) circle [radius=1]}}
  ]
  \draw [path picture={\fill[red,second circle];}] (4,10) circle [radius=1];
  \draw [second circle];
\end{tikzpicture}
\end{document}
gl_pathpicture.png

Antworten