2

I want to make a jigsaw circle with three pieces having text on them. It should look something like in the attached image. but I could be able to find a way o do that enter image description here

I found this code from one of the questions here questions here. but I could not find a way to edit it to get my desired result as I am new to Latex.

\documentclass{standalone}

\usepackage{tikz,stackengine} \setstackEOL{\}

\newcommand{\side}[1]{ (0.5,0.5) -- (0.0,#10.00) .. controls (0.0,#10.00) and (0.4,#1-0.04) .. (0.4,#10.04) .. controls (0.4,#10.11) and (0.2,#10.26) .. (0.5,#10.26) .. controls (0.8,#10.26) and (0.6,#10.11) .. (0.6,#10.04) .. controls (0.6,#1-0.04) and (1.0,#10.00) .. (1.0,#1*0.00) }

\newcommand{\piece}[6][white]{ \draw[#1,postaction={fill=gray!10}] \side{#2} [rotate around={90:(0.5,0.5)}] \side{#3} [rotate around={180:(0.5,0.5)}] \side{#4} [rotate around={270:(0.5,0.5)}] \side{#5} -- cycle; \node [black] at (.5,.5) {\Centerstack{#6}}; }

\begin{document}

\begin{tikzpicture}[scale=3.5]

\begin{scope} \piece[red]{1}{1}{0}{0}{my text\goes right\here} \end{scope} \begin{scope}[xshift=1cm] \piece[blue]{1}{-1}{-1}{0}{B} \end{scope} \begin{scope}[xshift=2cm] \piece[green]{1}{0}{1}{0}{C} \end{scope}

\end{tikzpicture}

\end{document}

user444
  • 211

2 Answers2

11
\documentclass[tikz, border=1cm]{standalone}
\newcommand{\side}[1]{
(-0.5,#1*0.00) .. controls (-0.5,#1*0.00) and (-0.1,#1*-0.04) .. 
(-0.1,#1*0.04) .. controls (-0.1,#1*0.11) and (-0.3,#1*0.26) .. 
(0.0,#1*0.26) .. controls (0.3,#1*0.26) and (0.1,#1*0.11) .. 
(0.1,#1*0.04) .. controls (0.1,#1*-0.04) and (0.5,#1*0.00) .. 
(0.5,#1*0.00)
}

\newcommand{\piece}[6][white]{
\draw[#1]
{[rotate=#2]  [shift={(1,0)}] \side{#4}}
arc[start angle=#2, end angle=#3, radius=1.5] 
{[rotate=#3]  [shift={(1,0)}] [rotate=180] -- \side{#5}}
arc[start angle=#3, end angle=#2, radius=0.5] -- cycle;
\node at ({(#2+#3)/2}:1) {#6};
}

\begin{document}
\begin{tikzpicture}[line join=round, ultra thick, text=white]
\piece[red!80!black, fill=red]{-80}{45}{-1}{1}{Why?}
\piece[green!80!black, fill=green]{170}{280}{-1}{1}{What?}
\piece[blue!80!black, fill=blue]{45}{170}{-1}{1}{How?}
\end{tikzpicture}
\end{document}

Circular puzzle with three pieces

3

The answer below uses the wheelchart package, which I wrote.

The arc at the start and the end of the slices is determined by the key slices arc.

The text in the slices is determined by the key wheel data.

enter image description here

\documentclass[border=6pt,dvipsnames]{standalone}
\usepackage{wheelchart}
\begin{document}
\begin{tikzpicture}
\wheelchart[
  data=,
  middle=Research,
  middle fill={
    left color=gray!50,
    right color=gray
  },
  middle style={font=\em\bfseries},
  radius={1}{3.3},
  slices arc={2}{0.8},
  slices style={
    left color=\WCvarA!50,
    right color=\WCvarA
  },
  start angle=45,
  value=1,
  wheel data=\WCvarB,
  wheel data pos=0.5,
  wheel data style={
    white,
    font=\em\bfseries\LARGE
  }
]{Red/WHY?,ForestGreen/WHAT?,RoyalBlue/HOW?}
\end{tikzpicture}
\end{document}
matexmatics
  • 4,819