% !TeX TXS-program:compile = txs:///pdflatex

\documentclass[a4paper,french,12pt]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{fontawesome5}
\usepackage{tikz,pgffor}
\usetikzlibrary{calc}
\usepackage{xstring}
\usepackage{simplekv}
\usepackage{listofitems}

\defKV[RoueEq]{%
	RayonPrincipal=\def\RDEQrayon{#1},%
	HauteurQuestion=\def\RDEQhautquest{#1},%
	Police=\def\RDEQpolice{#1},%
	Epaisseur=\def\RDEQthick{#1}
}

\setKVdefault[RoueEq]{%
	RayonPrincipal=5,%
	HauteurQuestion=2,%
	Police={},%
	Epaisseur=0.8pt,%
	Reponses=true,%
	Logo=true
}

\NewDocumentCommand\RoueEquations{ O{} m m }{%
	\restoreKV[RoueEq]%paramètres par défaut
	\setKV[RoueEq]{#1}%
	\readlist*\RDEQlisteequations{#2}%
	\def\RDEQnbquest{\RDEQlisteequationslen}
	\def\RDEQangle{\fpeval{round(360/\RDEQnbquest,2)}}
	\begin{tikzpicture}[line width=\RDEQthick,line cap=round,line join=bevel]
		%LES NŒUDS !!
		\foreach \i in {1,2,...,\RDEQnbquest}{%
			\coordinate (A\i) at ({\i*\RDEQangle}:{\RDEQrayon-\RDEQhautquest}) ;
			\coordinate (B\i) at ({\i*\RDEQangle}:{\RDEQrayon}) ;
		}%
		\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
			\def\j{\inteval{\i+1}}%
			\coordinate (I\i) at ($(B\i)!0.5!(B\j)$) ;
		}%
		\coordinate (I\RDEQnbquest) at ($(B1)!0.5!(B\RDEQnbquest)$) ;
		\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
			\def\j{\inteval{\i+1}}%
			\coordinate (C\j) at ([rotate around={180:(I\i)}]A\i);
			\coordinate (D\i) at ([rotate around={180:(I\i)}]A\j);
			%\filldraw (C\j) circle[radius=2pt] node{C\j} (D\i) circle[radius=2pt] node{D\i} ;
		}%
		\coordinate (C1) at ([rotate around={180:(I\RDEQnbquest)}]A\RDEQnbquest);
		\coordinate (D\RDEQnbquest) at ([rotate around={180:(I\RDEQnbquest)}]A1);
		%LES TRACÉS
		\ifboolKV[RoueEq]{Reponses}
			{%
				\draw (A1)--(B1)--(C1)--(D\RDEQnbquest)--(B\RDEQnbquest)--(A\RDEQnbquest)--cycle ;
				\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
					\def\j{\inteval{\i+1}}%
					\draw(B\i)--(B\j) ;
					\draw(A\i)--(B\i)--(D\i)--(C\j)--(B\j)--(A\j)--cycle ;
				}
				\draw (B1)--(B\RDEQnbquest) ;
			}%
			{%
					\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
						\def\j{\inteval{\i+1}}%
						\draw(A\i)--(B\i)--(B\j)--(A\j)--cycle ;
					}
					\draw (A1)--(A\RDEQnbquest) ;
					\draw (B1)--(B\RDEQnbquest) ;
			}%
		%LES NŒUDS DES QUESTIONS
		\foreach \foreach \i in {1,...,\RDEQnbquest}{%
			\coordinate (Q\i) at ({(\i+0.5)*\RDEQangle}:{(\RDEQrayon)*cos(0.5*\RDEQangle)+0.5*\RDEQhautquest*cos(0.5*\RDEQangle)}) ;
			\draw (Q\i)  node[rotate={(\i+0.5)*\RDEQangle-90},font=\RDEQpolice] {\RDEQlisteequations[\i]} ;
			\ifboolKV[RoueEq]{Reponses}
				{%
					\coordinate (R\i) at ({(\i+0.5)*\RDEQangle}:{(\RDEQrayon-\RDEQhautquest)*cos(0.5*\RDEQangle)+0.5*\RDEQhautquest*cos(0.5*\RDEQangle)}) ;
					\IfStrEq{#3}{}%
						{}%
						{%
							\readlist*\RDEQlistereponses{#3}%
							\draw (R\i) node[rotate={(\i+0.5)*\RDEQangle-90},font=\RDEQpolice]{\RDEQlistereponses[\i]} ;
						}%
				}%
				{}%
			}%
		\ifboolKV[RoueEq]{Logo}%
			{%
				\draw (0,{0.4*(\RDEQrayon-\RDEQhautquest)}) node[scale={1.66*(\RDEQrayon-\RDEQhautquest)}] {\scalebox{-1}[1]{\faRev}} ;
				\draw (0,{-0.25*(\RDEQrayon-\RDEQhautquest)}) node[scale={0.5*(\RDEQrayon-\RDEQhautquest)},font=\sffamily] {\parbox{\fpeval{0.75*(\RDEQrayon-\RDEQhautquest)}cm}{\centering La roue des questions}} ;
			}{}%
	\end{tikzpicture}%
	
	\vspace{5mm}
	
	\begin{tikzpicture}[line width=\RDEQthick,line cap=round,line join=bevel]
		%LES NŒUDS !!
		\foreach \i in {1,2,...,\RDEQnbquest}{%
			\coordinate (A\i) at ({\i*\RDEQangle}:{\RDEQrayon-\RDEQhautquest}) ;
			\coordinate (B\i) at ({\i*\RDEQangle}:{\RDEQrayon}) ;
		}%
		\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
			\def\j{\inteval{\i+1}}%
			\coordinate (I\i) at ($(B\i)!0.5!(B\j)$) ;
		}%
		\coordinate (I\RDEQnbquest) at ($(B1)!0.5!(B\RDEQnbquest)$) ;
		\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
			\def\j{\inteval{\i+1}}%
			\coordinate (C\j) at ([rotate around={180:(I\i)}]A\i);
			\coordinate (D\i) at ([rotate around={180:(I\i)}]A\j);
			%\filldraw (C\j) circle[radius=2pt] node{C\j} (D\i) circle[radius=2pt] node{D\i} ;
		}%
		\coordinate (C1) at ([rotate around={180:(I\RDEQnbquest)}]A\RDEQnbquest);
		\coordinate (D\RDEQnbquest) at ([rotate around={180:(I\RDEQnbquest)}]A1);
		%LES TRACÉS
		\ifboolKV[RoueEq]{Reponses}
		{%
			\draw (A1)--(B1)--(C1)--(D\RDEQnbquest)--(B\RDEQnbquest)--(A\RDEQnbquest)--cycle ;
			\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
				\def\j{\inteval{\i+1}}%
				\draw(B\i)--(B\j) ;
				\draw(A\i)--(B\i)--(D\i)--(C\j)--(B\j)--(A\j)--cycle ;
			}
			\draw (B1)--(B\RDEQnbquest) ;
		}%
		{%
			\foreach \i in {1,...,\inteval{\RDEQnbquest-1}}{%
				\def\j{\inteval{\i+1}}%
				\draw(A\i)--(B\i)--(B\j)--(A\j)--cycle ;
			}
			\draw (A1)--(A\RDEQnbquest) ;
			\draw (B1)--(B\RDEQnbquest) ;
		}%
		%LES NŒUDS DES QUESTIONS
		\foreach \foreach \i in {1,...,\RDEQnbquest}{%
			\coordinate (Q\i) at ({(-\i-0.5)*\RDEQangle}:{(\RDEQrayon)*cos(0.5*\RDEQangle)+0.5*\RDEQhautquest*cos(0.5*\RDEQangle)}) ;
			\draw (Q\i)  node[rotate={(-\i-0.5)*\RDEQangle+90},font=\RDEQpolice] {\RDEQlisteequations[\i]} ;
		}%
		\ifboolKV[RoueEq]{Logo}%
			{%
				\draw (0,{-0.4*(\RDEQrayon-\RDEQhautquest)}) node[scale={1.66*(\RDEQrayon-\RDEQhautquest)},rotate=180] {\scalebox{-1}[1]{\faRev}} ;
				\draw (0,{0.25*(\RDEQrayon-\RDEQhautquest)}) node[scale={0.5*(\RDEQrayon-\RDEQhautquest)},font=\sffamily,rotate=180] {\parbox{\fpeval{0.75*(\RDEQrayon-\RDEQhautquest)}cm}{\centering La roue des questions}} ;
			}{}%
	\end{tikzpicture}%
}

\begin{document}


\RoueEquations[RayonPrincipal=5,HauteurQuestion=1.5]{Q1,Q2,Q3,Q4,Q5,Q6}{R1,R2,R3,R4,R5,R6}

\pagebreak
%
%\hfill
%\RoueEquations[Logo=false,RayonPrincipal=5,HauteurQuestion=1.5]{,,,,,}{R1,R2,R3,R4,R5,R6}
%\hfill~

%\RoueEquations[RayonPrincipal=5,HauteurQuestion=1.5,Reponses=false]{Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8}{}

\end{document}