我创建的代码(MWE)如下:
\documentclass{article}
\usepackage[bahasai]{babel}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\definecolor{paper}{RGB}{239,227,157}
\usepackage{graphicx}
\title{lingkaran warna}
\author{aan triono }
\date{\today}
\begin{document}
\maketitle
\begin{tikzpicture}
\coordinate (O) at (0:0);
\coordinate (A) at (0:3);
\coordinate (B) at (60:3);
\coordinate (C) at (120:3);
\coordinate (D) at (180:3);
\coordinate (E) at (240:3);
\coordinate (F) at (300:3);
\foreach \t in {O,A,B,C,D,E,F}
\draw[very thick,paper] (\t) circle (3);
\begin{scope}[even odd rule]
%cakupan terhadap 6 lingkaran
\path[clip] (A) circle (3) (B) circle (3) (C) circle (3) (D) circle (3)
(E) circle (3) (F) circle (3);
%mengisi warna pada bagian terluar dari daerah 6 lingkaran
\fill[teal!90] (O) circle (3) (A) circle (3) (B) circle (3)
(C) circle (3) (D) circle (3) (E) circle (3) (F) circle (3);
\end{scope}
\begin{scope}[even odd rule]
%cakupan terhadap lingkaran pusat
\path[clip] (O) circle (3);
%mengisi warna pada lingkaran pusat
\fill[ForestGreen!80] (O) circle (3);
%mengisi warna pada 6 daerah yang masing-masing diapit oleh dua busur
\fill[red] (B) arc(120:240:3) %pusat A
arc(0:120:3) %pusat E
arc(-120:0:3) %pusat C
(A) arc(60:180:3) %pusat F
arc(-60:60:3) %pusat D
arc(180:300:3) ;%pusat B
] (0,0) circle (1.5);
\end{scope}
\begin{scope}[even odd rule]
\fill[yellow] (A) arc(-60:0:3) arc(60:120:3) arc(60:0:3)
(B) arc(0:60:3) arc(120:180:3) arc(120:60:3)
(C) arc(60:120:3) arc(180:240:3) arc(180:120:3)
(D) arc(120:180:3) arc(240:300:3) arc(240:180:3)
(E) arc(180:240:3) arc(-60:0:3) arc(300:240:3)
(F) arc(240:300:3) arc(0:60:3) arc(0:-60:3);
\end{scope}
\end{tikzpicture}
\end{document}
如果我插入图片,图片会遮住圆角。这就是我的问题。谢谢大家的帮助。
答案1
你可以\clip
这样使用:
\documentclass{article}
\usepackage[bahasai]{babel}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\definecolor{paper}{RGB}{239,227,157}
\usepackage{graphicx}
\title{lingkaran warna}
\author{aan triono }
\date{\today}
\begin{document}
\maketitle
\begin{tikzpicture}
\coordinate (O) at (0:0);
\coordinate (A) at (0:3);
\coordinate (B) at (60:3);
\coordinate (C) at (120:3);
\coordinate (D) at (180:3);
\coordinate (E) at (240:3);
\coordinate (F) at (300:3);
\foreach \t in {O,A,B,C,D,E,F}
\draw[very thick,paper] (\t) circle (3);
\begin{scope}[even odd rule]
%cakupan terhadap 6 lingkaran
\path[clip] (A) circle (3) (B) circle (3) (C) circle (3) (D) circle (3)
(E) circle (3) (F) circle (3);
%mengisi warna pada bagian terluar dari daerah 6 lingkaran
\fill[teal!90] (O) circle (3) (A) circle (3) (B) circle (3)
(C) circle (3) (D) circle (3) (E) circle (3) (F) circle (3);
\end{scope}
\begin{scope}[even odd rule]
%cakupan terhadap lingkaran pusat
\path[clip] (O) circle (3);
%mengisi warna pada lingkaran pusat
\fill[ForestGreen!80] (O) circle (3);
%mengisi warna pada 6 daerah yang masing-masing diapit oleh dua busur
\begin{scope}
\clip (B) arc(120:240:3) %pusat A
arc(0:120:3) %pusat E
arc(-120:0:3) %pusat C
(A) arc(60:180:3) %pusat F
arc(-60:60:3) %pusat D
arc(180:300:3) ;%pusat B
] (0,0) circle (1.5);
\node at (0,0) {\includegraphics[width=10cm]{example-image-duck}};
\end{scope}
\end{scope}
\begin{scope}[even odd rule]
\fill[yellow] (A) arc(-60:0:3) arc(60:120:3) arc(60:0:3)
(B) arc(0:60:3) arc(120:180:3) arc(120:60:3)
(C) arc(60:120:3) arc(180:240:3) arc(180:120:3)
(D) arc(120:180:3) arc(240:300:3) arc(240:180:3)
(E) arc(180:240:3) arc(-60:0:3) arc(300:240:3)
(F) arc(240:300:3) arc(0:60:3) arc(0:-60:3);
\end{scope}
\end{tikzpicture}
\end{document}
或者这里有两张不同的图片:
\documentclass{article}
\usepackage[bahasai]{babel}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\definecolor{paper}{RGB}{239,227,157}
\usepackage{graphicx}
\title{lingkaran warna}
\author{aan triono }
\date{\today}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0:0);
\coordinate (A) at (0:3);
\coordinate (B) at (60:3);
\coordinate (C) at (120:3);
\coordinate (D) at (180:3);
\coordinate (E) at (240:3);
\coordinate (F) at (300:3);
\begin{scope}[even odd rule]
\clip
(O) circle(3)
(A) arc(-60:0:3) arc(60:120:3) arc(60:0:3)
(B) arc(0:60:3) arc(120:180:3) arc(120:60:3)
(C) arc(60:120:3) arc(180:240:3) arc(180:120:3)
(D) arc(120:180:3) arc(240:300:3) arc(240:180:3)
(E) arc(180:240:3) arc(-60:0:3) arc(300:240:3)
(F) arc(240:300:3) arc(0:60:3) arc(0:-60:3);
\node at (0,0) {\includegraphics[width=11cm]{example-grid-100x100bp}};
\end{scope}
\begin{scope}
\clip (B) arc(120:240:3) %pusat A
arc(0:120:3) %pusat E
arc(-120:0:3) %pusat C
(A) arc(60:180:3) %pusat F
arc(-60:60:3) %pusat D
arc(180:300:3) ;%pusat B
] (0,0) circle (1.5);
\node at (0,0) {\includegraphics[width=10cm]{example-image-duck}};
\end{scope}
\end{tikzpicture}
\end{document}
答案2
相同的想法(参见优秀的 samcarter_is_at_topanswers.xyz 的答案)但代码较少。
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\clip (0,0) foreach\i in {0,60,...,300} {[rotate=\i] arc (90:30:2) arc (270:330:2) arc (30:90:2) arc (330:270:2)};
\node {\includegraphics[height=6cm]{example-image-duck}};
\end{scope}
\begin{scope}
\clip (0,0) foreach\i in {0,60,...,300} {[rotate=\i] arc (270:330:2) arc (90:150:2)};
\node {\includegraphics[width=6cm]{example-grid-100x100bp}};
\end{scope}
\draw[white] (0,0) foreach\i in {0,60,...,300} {[rotate=\i] arc (270:330:2) arc (90:150:2)};
\end{tikzpicture}
\end{document}