% Fichiers comprenant les macros de construction des patrons de solides

% \patronprismereg[	n = nombre de côtés de la base,
%					h = hauteur du prisme,
%					r = rayon du cercle circonscrit à la base,
%					pos = 1 ou 2 ou ... ou n (position de la face du haut)
%					legende (booléen)]

\define@cmdkey [PAS] {patronprismereg} {r}{}
\define@cmdkey [PAS] {patronprismereg} {h}{}
\define@cmdkey [PAS] {patronprismereg} {n}{}
\define@cmdkey [PAS] {patronprismereg} {pos}{}
\define@boolkey[PAS] {patronprismereg} {legende}[true]{}

\presetkeys    [PAS] {patronprismereg} {
										n = 3,
										r = 3,
										h = 5,
										pos = 1,
										legende = false}{}

\newcommand*{\patronprismereg}[1][]{\pasPatronprismereg[#1]}

\def\pasPatronprismereg[#1]{
	\setkeys[PAS]{patronprismereg}{#1}
	\pgfmathparse{360/\cmdPAS@patronprismereg@n}\let\angle\pgfmathresult
	\foreach \i in {1,...,\cmdPAS@patronprismereg@n}
		{
			\pgfmathparse{\cmdPAS@patronprismereg@r*cos(\angle*(\i-1))}\let\x\pgfmathresult
			\pgfmathparse{\cmdPAS@patronprismereg@r*sin(\angle*(\i-1))}\let\y\pgfmathresult
			\coordinate (A\i) at (\x,\y);
			
			\pgfmathparse{\cmdPAS@patronprismereg@r*cos(\angle*\i)}\let\x\pgfmathresult
			\pgfmathparse{\cmdPAS@patronprismereg@r*sin(\angle*\i)}\let\y\pgfmathresult
			\coordinate (D\i) at (\x,\y);

			\pgfmathparse{\cmdPAS@patronprismereg@h*cos(\angle/2+(\i-1)*\angle)}\let\x\pgfmathresult
			\pgfmathparse{\cmdPAS@patronprismereg@h*sin(\angle/2+(\i-1)*\angle)}\let\y\pgfmathresult
			\coordinate (B\i) at ($(A\i)+(\x,\y)$);
			\coordinate (C\i) at ($(D\i)+(\x,\y)$);
			
			\draw (A\i) -- (D\i) -- (C\i) -- (B\i) -- cycle;
		}
		
	\ifPAS@patronprismereg@legende
			\draw[dotted] (D1) -- (0,0) -- (A1);
			\pgfmathparse{.5*cos(\angle/2)}\let\x\pgfmathresult
			\pgfmathparse{.5*sin(\angle/2)}\let\y\pgfmathresult
			\draw[dotted,<->,>=stealth'] (.5,0) arc (0:\angle:.5cm);
			\node[right,scale=.5] at (\x,\y) {\angle $^{\circ}$};
			\node[below,scale=.5] at (\cmdPAS@patronprismereg@r/2,0) {\cmdPAS@patronprismereg@r};
			\coordinate (M) at (barycentric cs:A1=1,D1=1);
			\coordinate (N) at (barycentric cs:B1=1,C1=1);
			\draw[<->,>=stealth',dotted] (M) -- (N) node[midway,above,scale=.5,rotate=\angle/2] {\cmdPAS@patronprismereg@h};
	\fi
		
	% Face du haut
	\pgfmathparse{2*\cmdPAS@patronprismereg@r*cos(\angle/2)+\cmdPAS@patronprismereg@h}\let\d\pgfmathresult
	\pgfmathparse{\d*cos(\angle/2+(\cmdPAS@patronprismereg@pos-1)*\angle)}\let\tx\pgfmathresult
	\pgfmathparse{\d*sin(\angle/2+(\cmdPAS@patronprismereg@pos-1)*\angle)}\let\ty\pgfmathresult
	\coordinate (O) at (\tx,\ty);
	\foreach \i in {1,...,\cmdPAS@patronprismereg@n}
		{
			\coordinate (C\i) at ($(A\i)+(\tx,\ty)$);
			\coordinate (B\i) at (barycentric cs:C\i=1,O=-2);
		}
		
	\draw (B1) \foreach \i in {2,...,\cmdPAS@patronprismereg@n}{-- (B\i)} -- cycle;
}

% \patronpyramreg[	n = nombre de côtés de la base,
%					h = hauteur de la pyramide,
%					r = rayon du cercle circonscrit à la base,
%					legende (booléen)]

\define@cmdkey [PAS] {patronpyramreg} {r}{}
\define@cmdkey [PAS] {patronpyramreg} {h}{}
\define@cmdkey [PAS] {patronpyramreg} {n}{}
\define@boolkey[PAS] {patronpyramreg} {legende}[true]{}

\presetkeys    [PAS] {patronpyramreg} {
								n = 3,
								r = 3,
								h = 5,
 							 	legende = false}{}

\newcommand*{\patronpyramreg}[1][]{\pasPatronpyramreg[#1]}

\def\pasPatronpyramreg[#1]{
	\setkeys[PAS]{patronpyramreg}{#1}
	\foreach \i in {1,...,\cmdPAS@patronpyramreg@n}
		{
			\pgfmathparse{\cmdPAS@patronpyramreg@r*cos((360/\cmdPAS@patronpyramreg@n)*(\i-1))}\let\x\pgfmathresult
			\pgfmathparse{\cmdPAS@patronpyramreg@r*sin((360/\cmdPAS@patronpyramreg@n)*(\i-1))}\let\y\pgfmathresult
			\coordinate (A\i) at (\x,\y);
			\pgfmathparse{(\cmdPAS@patronpyramreg@h+\cmdPAS@patronpyramreg@r*cos(180/\cmdPAS@patronpyramreg@n))*cos((360/\cmdPAS@patronpyramreg@n)*(\i-1)+(180/\cmdPAS@patronpyramreg@n))}\let\x\pgfmathresult
			\pgfmathparse{(\cmdPAS@patronpyramreg@h+\cmdPAS@patronpyramreg@r*cos(180/\cmdPAS@patronpyramreg@n))*sin((360/\cmdPAS@patronpyramreg@n)*(\i-1)+(180/\cmdPAS@patronpyramreg@n))}\let\y\pgfmathresult
			\coordinate (S\i) at (\x,\y);
		}
	\draw (A1) -- (S1) \foreach \i in {2,...,\cmdPAS@patronpyramreg@n} {-- (A\i) -- (S\i)} -- cycle;
	\draw (A1) \foreach \i in {2,...,\cmdPAS@patronpyramreg@n} {-- (A\i)} -- cycle;
	\ifPAS@patronpyramreg@legende
			\draw[dotted] (A1) -- (0,0) -- (A2);
			\pgfmathparse{360/\cmdPAS@patronpyramreg@n}\let\angle\pgfmathresult
			\pgfmathparse{.5*cos(180/\cmdPAS@patronpyramreg@n)}\let\x\pgfmathresult
			\pgfmathparse{.5*sin(180/\cmdPAS@patronpyramreg@n)}\let\y\pgfmathresult
			\draw[dotted,<->,>=stealth'] (.5,0) arc (0:\angle:.5cm);
			\node[right,scale=.5] at (\x,\y) {\angle $^{\circ}$};
			\node[below,scale=.5] at (\cmdPAS@patronpyramreg@r/2,0) {\cmdPAS@patronpyramreg@r};
			\coordinate (M) at (barycentric cs:A1=1,A2=1);
			\draw[<->,>=stealth',dotted] (M) -- (S1) node[midway,above,scale=.5,rotate=\angle/2] {\cmdPAS@patronpyramreg@h};
	\fi
}

% \patroncone
% Synthaxe : \patroncone[	r = rayon de la base,
%							h = hauteur du cône,
%							legende (booléen)]

\define@cmdkey [PAS] {patroncone} {r}{}
\define@cmdkey [PAS] {patroncone} {h}{}
\define@boolkey[PAS] {patroncone} {legende}[true]{}

\presetkeys    [PAS] {patroncone} {
								r = 3,
								h = 5,
 							 	legende = false}{}

\newcommand*{\patroncone}[1][]{\pasPatroncone[#1]}

\def\pasPatroncone[#1]{
	\setkeys[PAS]{patroncone}{#1}
	\pgfmathparse{360*\cmdPAS@patroncone@r/\cmdPAS@patroncone@h}\let\angle\pgfmathresult
	\draw (0,-\cmdPAS@patroncone@h-\cmdPAS@patroncone@r) circle (\cmdPAS@patroncone@r cm);
	\pgfmathparse{\cmdPAS@patroncone@h*cos(270-\angle/2)}\let\x\pgfmathresult
	\pgfmathparse{\cmdPAS@patroncone@h*sin(270-\angle/2)}\let\y\pgfmathresult
	\draw (0,0) -- (\x,\y) arc (270-\angle/2:270+\angle/2:\cmdPAS@patroncone@h cm) -- cycle;
	\ifPAS@patroncone@legende
			\node[below] at (\x/2,\y/2) {\cmdPAS@patroncone@h};
			\node[below] at (-\x/2,\y/2) {\cmdPAS@patroncone@h};
			\pgfmathparse{cos(270-\angle/2)}\let\x\pgfmathresult
			\pgfmathparse{sin(270-\angle/2)}\let\y\pgfmathresult
			\draw[<->,>=stealth'] (\x,\y) arc (270-\angle/2:270+\angle/2:1cm);
			\node[above,scale=.5] at (0,-1.3) {\angle $^{\circ}$};
			\pgfmathparse{\cmdPAS@patroncone@r*cos(-30)}\let\x\pgfmathresult
			\pgfmathparse{\cmdPAS@patroncone@r*sin(-30)-\cmdPAS@patroncone@h-\cmdPAS@patroncone@r}\let\y\pgfmathresult
			\draw[<->,>=stealth'] (0,-\cmdPAS@patroncone@h-\cmdPAS@patroncone@r) -- (\x,\y) node[midway,above] {\cmdPAS@patroncone@r};
	\fi
}

% \patroncylindre
% Synthaxe : \patroncylindre[	r = rayon de la base,
%								h = hauteur du cône,
%								legende (booléen)]

\define@cmdkey [PAS] {patroncylindre} {r}{}
\define@cmdkey [PAS] {patroncylindre} {h}{}
\define@boolkey[PAS] {patroncylindre} {legende}[true]{}

\presetkeys    [PAS] {patroncylindre} {
								r = 2,
								h = 5,
 							 	legende = false}{}

\newcommand*{\patroncylindre}[1][]{\pasPatroncylindre[#1]}

\def\pasPatroncylindre[#1]{
	\setkeys[PAS]{patroncylindre}{#1}
	\draw (0,\cmdPAS@patroncylindre@h+\cmdPAS@patroncylindre@r) circle (\cmdPAS@patroncylindre@r cm);
	\draw (0,-\cmdPAS@patroncylindre@r) circle (\cmdPAS@patroncylindre@r cm);
	\pgfmathparse{\cmdPAS@patroncylindre@r*3.19159}\let\demilongueur\pgfmathresult
	\draw (-\demilongueur,0) rectangle +(2*\demilongueur,\cmdPAS@patroncylindre@h);
	\ifPAS@patroncylindre@legende
			\draw[<->,>=stealth'] (-\demilongueur,-2*\cmdPAS@patroncylindre@r-1) -- (\demilongueur,-2*\cmdPAS@patroncylindre@r-1) node[midway,fill=white] {$2\pi \times \cmdPAS@patroncylindre@r$};
			\draw[dotted] (-\demilongueur,0) -- (-\demilongueur,-2*\cmdPAS@patroncylindre@r-1);
			\draw[dotted] (\demilongueur,0) -- (\demilongueur,-2*\cmdPAS@patroncylindre@r-1);
			\draw[<->,>=stealth'] (\demilongueur+1,0) -- (\demilongueur+1,\cmdPAS@patroncylindre@h) node[midway,right] {\cmdPAS@patroncylindre@h};
			\draw[dotted] (\demilongueur,0) -- (\demilongueur+1,0);
			\draw[dotted] (\demilongueur,\cmdPAS@patroncylindre@h) -- (\demilongueur+1,\cmdPAS@patroncylindre@h);
			\draw[<->,>=stealth'] (0,\cmdPAS@patroncylindre@h+\cmdPAS@patroncylindre@r) -- (\cmdPAS@patroncylindre@r,\cmdPAS@patroncylindre@h+\cmdPAS@patroncylindre@r) node[midway,fill=white] {\cmdPAS@patroncylindre@r};
			\draw[<->,>=stealth'] (0,-\cmdPAS@patroncylindre@r) -- (\cmdPAS@patroncylindre@r,-\cmdPAS@patroncylindre@r) node[midway,fill=white] {\cmdPAS@patroncylindre@r};
	\fi
}


% \patronpave : dessine un patron de pavé droit
% Synthaxe : \patronpave[	a = dimension 1,
%							b = dimension 2,
%							c = dimension 3,
%							pos = position des rabats (1, 2, 3 ou 4),
%							codages (booléen),
%							legende (booléen)]

\define@cmdkey [PAS] {patronpave} {a}{}
\define@cmdkey [PAS] {patronpave} {b}{}
\define@cmdkey [PAS] {patronpave} {c}{}
\define@cmdkey [PAS] {patronpave} {pos}{}
\define@boolkey[PAS] {patronpave} {codages}[true]{}
\define@boolkey[PAS] {patronpave} {legende}[true]{}

\presetkeys    [PAS] {patronpave} {
								a = 3,
								b = 3,
 							 	c = 3,
								pos = 2,
 							 	codages = false,
 							 	legende = false}{}

\newcommand*{\patronpave}[1][]{\pasPatronpave[#1]}

\def\pasPatronpave[#1]{
	\setkeys[PAS]{patronpave}{#1}
	\draw (0,0) rectangle +(2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b);
	\draw (\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b);
	\draw (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,\cmdPAS@patronpave@b);
	\draw (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,\cmdPAS@patronpave@b);
	\ifPAS@patronpave@codages
			\node[scale=.5] at (\cmdPAS@patronpave@c/2,\cmdPAS@patronpave@b) {///};
			\node[scale=.5] at (\cmdPAS@patronpave@c/2,0) {///};
			\node[scale=.5] at (3*\cmdPAS@patronpave@c/2+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) {///};
			\node[scale=.5] at (3*\cmdPAS@patronpave@c/2+\cmdPAS@patronpave@a,0) {///};
			\node[scale=.5] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a/2,0) {/};
			\node[scale=.5] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a/2,\cmdPAS@patronpave@b) {/};
			\node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,0) {/};
			\node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,\cmdPAS@patronpave@b) {/};
			\node[rotate=90,scale=.5] at (0,\cmdPAS@patronpave@b/2) {//};
			\node[rotate=90,scale=.5] at (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b/2) {//};
			\node[rotate=90,scale=.5] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b/2) {//};
			\node[rotate=90,scale=.5] at (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b/2) {//};
			\node[rotate=90,scale=.5] at (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b/2) {//};
	\fi
	\IfStrEq{\cmdPAS@patronpave@pos}{1}
		{
			\draw (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) rectangle +(\cmdPAS@patronpave@c,-2*\cmdPAS@patronpave@a-\cmdPAS@patronpave@b);
			\ifPAS@patronpave@codages
				\node[scale=.5,rotate=90] at (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/};
				\node[scale=.5] at (\cmdPAS@patronpave@c/2,\cmdPAS@patronpave@a+\cmdPAS@patronpave@b) {///};
				\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/};
				\node[scale=.5,rotate=90] at (0,-\cmdPAS@patronpave@a/2) {/};
				\node[scale=.5] at (\cmdPAS@patronpave@c/2,-\cmdPAS@patronpave@a) {///};
				\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,-\cmdPAS@patronpave@a/2) {/};
			\fi
			\ifPAS@patronpave@legende
				\draw[gray,dotted] (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1);
				\draw[gray,dotted] (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1);
				\draw[<->,>=stealth'] (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) node[midway,above] {\cmdPAS@patronpave@c};
				\draw[gray,dotted] (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,0) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-1);
				\draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,0) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,-1);
				\draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-1) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,-1) node[midway,below] {\cmdPAS@patronpave@a};
			\fi
		}
		{
			\IfStrEq{\cmdPAS@patronpave@pos}{2}
			{
				\draw (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) rectangle +(\cmdPAS@patronpave@a,-2*\cmdPAS@patronpave@c-\cmdPAS@patronpave@b);
				\ifPAS@patronpave@codages
					\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///};
					\node[scale=.5] at (\cmdPAS@patronpave@a/2+\cmdPAS@patronpave@c,\cmdPAS@patronpave@c+\cmdPAS@patronpave@b) {/};
					\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///};
					\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,-\cmdPAS@patronpave@c/2) {///};
					\node[scale=.5] at (\cmdPAS@patronpave@a/2+\cmdPAS@patronpave@c,-\cmdPAS@patronpave@c) {/};
					\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-\cmdPAS@patronpave@c/2) {///};
				\fi
				\ifPAS@patronpave@legende
					\draw[gray,dotted] (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1);
					\draw[gray,dotted] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1);
					\draw[<->,>=stealth'] (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) -- (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) node[midway,above] {\cmdPAS@patronpave@a};
					\draw[gray,dotted] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1);
					\draw[<->,>=stealth'] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) node[midway,above] {\cmdPAS@patronpave@c};
				\fi
			}
			{
				\IfStrEq{\cmdPAS@patronpave@pos}{3}
				{
					\draw (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) rectangle +(\cmdPAS@patronpave@c,-2*\cmdPAS@patronpave@a-\cmdPAS@patronpave@b);
					\ifPAS@patronpave@codages
						\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/};
						\node[scale=.5] at (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c+\cmdPAS@patronpave@c/2,\cmdPAS@patronpave@a+\cmdPAS@patronpave@b) {///};
						\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/};
						\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,-\cmdPAS@patronpave@a/2) {/};
						\node[scale=.5] at (\cmdPAS@patronpave@a+3*\cmdPAS@patronpave@c/2,-\cmdPAS@patronpave@a) {///};
						\node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,-\cmdPAS@patronpave@a/2) {/};
					\fi
					\ifPAS@patronpave@legende
						\draw[gray,dotted] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1);
						\draw[gray,dotted] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1);
						\draw[<->,>=stealth'] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) node[midway,above] {\cmdPAS@patronpave@c};
						\draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1);
						\draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) node[midway,above] {\cmdPAS@patronpave@a};
					\fi
				}
				{
					\draw (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) rectangle +(\cmdPAS@patronpave@a,-2*\cmdPAS@patronpave@c-\cmdPAS@patronpave@b);
					\ifPAS@patronpave@codages
						\node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///};
						\node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,\cmdPAS@patronpave@c+\cmdPAS@patronpave@b) {/};
						\node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///};
						\node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-\cmdPAS@patronpave@c/2) {///};
						\node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,-\cmdPAS@patronpave@c) {/};
						\node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,-\cmdPAS@patronpave@c/2) {///};
					\fi
					\ifPAS@patronpave@legende
						\draw[gray,dotted] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1);
						\draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1);
						\draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) node[midway,above] {\cmdPAS@patronpave@a};
						\draw[gray,dotted] (0,0) -- (0,-1);
						\draw[gray,dotted] (\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@c,-1);
						\draw[<->,>=stealth'] (0,-1) -- (\cmdPAS@patronpave@c,-1) node[midway,below] {\cmdPAS@patronpave@c};
					\fi
				}
			}
		}
		\ifPAS@patronpave@legende
			\draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,\cmdPAS@patronpave@b);
			\draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,0) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,0);
			\draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,0) node[midway,right] {\cmdPAS@patronpave@b};
		\fi
}
