| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} |
| 3 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') |
| 4 |
|
| 5 |
\documentclass[french,a4paper,11pt]{article} |
| 6 |
\usepackage[margin=2cm,includefoot]{geometry} |
| 7 |
\def\TPversion{0.1.1} |
| 8 |
\def\TPdate{28 Mai 2023} |
| 9 |
\usepackage[utf8]{inputenc} |
| 10 |
\usepackage[T1]{fontenc} |
| 11 |
\usepackage{amsmath,amssymb} |
| 12 |
\usepackage{tikz2d-fr} |
| 13 |
\usepackage{tkz-euclide} |
| 14 |
\usepackage{awesomebox} |
| 15 |
\usepackage{fontawesome5} |
| 16 |
\usepackage{footnote} |
| 17 |
\makesavenoteenv{tabular} |
| 18 |
\usepackage{enumitem} |
| 19 |
\usepackage{tabularray} |
| 20 |
\usepackage{fancyvrb} |
| 21 |
\usepackage{fancyhdr} |
| 22 |
\fancyhf{} |
| 23 |
\renewcommand{\headrulewidth}{0pt} |
| 24 |
\lfoot{\sffamily\small [tikz2d-fr]} |
| 25 |
\cfoot{\sffamily\small - \thepage{} -} |
| 26 |
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} |
| 27 |
|
| 28 |
%\usepackage{hvlogos} |
| 29 |
\usepackage{hologo} |
| 30 |
\providecommand\tikzlogo{Ti\textit{k}Z} |
| 31 |
\providecommand\TeXLive{\TeX{}Live\xspace} |
| 32 |
\providecommand\PSTricks{\textsf{PSTricks}\xspace} |
| 33 |
\let\pstricks\PSTricks |
| 34 |
\let\TikZ\tikzlogo |
| 35 |
\newcommand\TableauDocumentation{% |
| 36 |
\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} |
| 37 |
{\LARGE \LaTeX} & & & & &\\ |
| 38 |
& {\LARGE \hologo{pdfLaTeX}} & & & & \\ |
| 39 |
& & {\LARGE \hologo{LuaLaTeX}} & & & \\ |
| 40 |
& & & {\LARGE \TikZ} & & \\ |
| 41 |
& & & & {\LARGE \TeXLive} & \\ |
| 42 |
& & & & & {\LARGE \hologo{MiKTeX}} \\ |
| 43 |
\end{tblr} |
| 44 |
} |
| 45 |
|
| 46 |
\usepackage{hyperref} |
| 47 |
\urlstyle{same} |
| 48 |
\hypersetup{pdfborder=0 0 0} |
| 49 |
\setlength{\parindent}{0pt} |
| 50 |
\definecolor{LightGray}{gray}{0.9} |
| 51 |
|
| 52 |
\usepackage{babel} |
| 53 |
\AddThinSpaceBeforeFootnotes |
| 54 |
\FrenchFootnotes |
| 55 |
|
| 56 |
\usepackage[most]{tcolorbox} |
| 57 |
\tcbuselibrary{listings} |
| 58 |
\newtcblisting{DemoCode}[1][]{% |
| 59 |
enhanced,width=0.95\linewidth,center,% |
| 60 |
bicolor,size=title,% |
| 61 |
colback=cyan!2!white,% |
| 62 |
colbacklower=cyan!1!white,% |
| 63 |
colframe=cyan!75!black,% |
| 64 |
listing options={% |
| 65 |
breaklines=true,% |
| 66 |
breakatwhitespace=true,% |
| 67 |
style=tcblatex,basicstyle=\small\ttfamily,% |
| 68 |
tabsize=4,% |
| 69 |
commentstyle={\itshape\color{gray}}, |
| 70 |
keywordstyle={\color{blue}},% |
| 71 |
classoffset=0,% |
| 72 |
keywords={},% |
| 73 |
alsoletter={-},% |
| 74 |
keywordstyle={\color{blue}},% |
| 75 |
classoffset=1,% |
| 76 |
alsoletter={-},% |
| 77 |
morekeywords={\draw,node,\coordinate,tikz3d-fr},% |
| 78 |
keywordstyle={\color{violet}},% |
| 79 |
classoffset=2,% |
| 80 |
alsoletter={-},% |
| 81 |
morekeywords={\TracerSegments,\DefinirPoints,\DefinirPoint,\MarquerPoint,\MarquerPoints,mainlevee,\ImagePoint,\ImagesPoints},% |
| 82 |
keywordstyle={\color{green!50!black}},% |
| 83 |
classoffset=3,% |
| 84 |
morekeywords={Cap,Style,Couleurs,Cycle,Join,line,cap,line,join,Suite,Couleurs,DecalLabel,StyleMarque,Couleur,Math,TaillePolice},% |
| 85 |
keywordstyle={\color{orange}} |
| 86 |
},% |
| 87 |
#1 |
| 88 |
} |
| 89 |
|
| 90 |
\tcbset{vignettes/.style={% |
| 91 |
nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,% |
| 92 |
boxrule=0.75pt,left=7pt,right=1pt,top=0pt,bottom=0.25pt,% |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
\tcbset{vignetteMaJ/.style={% |
| 97 |
fontupper={\vphantom{pf}\footnotesize\ttfamily}, |
| 98 |
vignettes,colframe=purple!50!black,coltitle=white,colback=purple!10,% |
| 99 |
overlay={\begin{tcbclipinterior}% |
| 100 |
\fill[fill=purple!75]($(interior.south west)$) rectangle node[rotate=90]{\tiny \sffamily{\textcolor{black}{\scalebox{0.66}[0.66]{\textbf{MàJ}}}}} ($(interior.north west)+(5pt,0pt)$);% |
| 101 |
\end{tcbclipinterior}} |
| 102 |
} |
| 103 |
} |
| 104 |
|
| 105 |
\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}} |
| 106 |
\newcommand\cmaj[1]{\tcbox[vignetteMaJ]{#1}\xspace} |
| 107 |
|
| 108 |
\begin{document} |
| 109 |
|
| 110 |
\setlength{\aweboxleftmargin}{0.07\linewidth} |
| 111 |
\setlength{\aweboxcontentwidth}{0.93\linewidth} |
| 112 |
\setlength{\aweboxvskip}{8pt} |
| 113 |
|
| 114 |
\pagestyle{fancy} |
| 115 |
|
| 116 |
\thispagestyle{empty} |
| 117 |
|
| 118 |
\vspace{2cm} |
| 119 |
|
| 120 |
\begin{center} |
| 121 |
\begin{minipage}{0.75\linewidth} |
| 122 |
\begin{tcolorbox}[colframe=yellow,colback=yellow!15] |
| 123 |
\begin{center} |
| 124 |
\begin{tabular}{c} |
| 125 |
{\Huge \texttt{tikz2d-fr}}\\ |
| 126 |
\\ |
| 127 |
{\LARGE Quelques commandes simplifiées (fr)} \\ |
| 128 |
\\ |
| 129 |
{\LARGE pour utiliser avec \TikZ.} \\ |
| 130 |
\end{tabular} |
| 131 |
|
| 132 |
\bigskip |
| 133 |
|
| 134 |
{\small \texttt{Version \TPversion{} -- \TPdate}} |
| 135 |
\end{center} |
| 136 |
\end{tcolorbox} |
| 137 |
\end{minipage} |
| 138 |
\end{center} |
| 139 |
|
| 140 |
\begin{center} |
| 141 |
\begin{tabular}{c} |
| 142 |
\texttt{Cédric Pierquet}\\ |
| 143 |
{\ttfamily c pierquet -- at -- outlook . fr}\\ |
| 144 |
\texttt{\url{https://github.com/cpierquet/tikz2dfr}} |
| 145 |
\end{tabular} |
| 146 |
\end{center} |
| 147 |
|
| 148 |
\vspace{0.25cm} |
| 149 |
|
| 150 |
{$\blacktriangleright$~~Définir des points par coordonnées.} |
| 151 |
|
| 152 |
\smallskip |
| 153 |
|
| 154 |
{$\blacktriangleright$~~Définir des points par transformations simples.} |
| 155 |
|
| 156 |
\smallskip |
| 157 |
|
| 158 |
{$\blacktriangleright$~~Tracer des segments, avec option(s) de couleurs.} |
| 159 |
|
| 160 |
\smallskip |
| 161 |
|
| 162 |
{$\blacktriangleright$~~Marquer des points.} |
| 163 |
|
| 164 |
\vspace{1cm} |
| 165 |
|
| 166 |
\begin{center} |
| 167 |
\begin{tcolorbox}[enhanced,colframe=cyan,colback=cyan!2,center,width=0.95\linewidth,drop fuzzy shadow=lightgray] |
| 168 |
\hfill |
| 169 |
\begin{tikzpicture} |
| 170 |
\DefinirPoints[Couleur=violet,DecalLabel=0pt]{A/0,0/b B/4,0/b C/3,2/h} |
| 171 |
\TracerSegments[Suite,Cycle,Couleurs=red,Join=bevel]{A B C} |
| 172 |
\end{tikzpicture} |
| 173 |
\hspace{1cm} |
| 174 |
\begin{tikzpicture} |
| 175 |
\DefinirPoints[DecalLabel=1pt]{A/0,0/bg B/4,0/bd C/3,2/h} |
| 176 |
\TracerSegments[Suite,Cycle,Couleurs={red,blue,green}]<thick,mainlevee>{A B C} |
| 177 |
\MarquerPoints[StyleMarque=x]{A}\MarquerPoints[StyleMarque=+]{B}\MarquerPoints{C} |
| 178 |
\end{tikzpicture} |
| 179 |
\hfill~ |
| 180 |
|
| 181 |
\vspace{1cm} |
| 182 |
|
| 183 |
\hfill~ |
| 184 |
\begin{tikzpicture} |
| 185 |
\DefinirPoints*{A_1/0:2/ A_2/45:2/ A_3/90:2/ A_4/135:2/ A_5/180:2/ A_6/225:2/ A_7/270:2/ A_8/315:2/} |
| 186 |
\TracerSegments[Suite,Cycle,Couleurs={red,blue,green,yellow,orange,pink,gray,violet}]<thick,mainlevee=1cm et 1mm>{A_1 A_2 A_3 A_4 A_5 A_6 A_7 A_8} |
| 187 |
\TracerSegments[]<semithick,densely dotted,mainlevee>{A_1/A_5 A_2/A_6 A_3/A_7 A_4/A_8} |
| 188 |
\end{tikzpicture} |
| 189 |
\hfill~ |
| 190 |
\end{tcolorbox} |
| 191 |
\end{center} |
| 192 |
|
| 193 |
\vspace{0.5cm} |
| 194 |
|
| 195 |
%\hfill{}\textit{Merci à Denis Bitouzé et à Gilles Le Bourhis pour leurs retours et idées !} |
| 196 |
|
| 197 |
\smallskip |
| 198 |
|
| 199 |
\vfill |
| 200 |
|
| 201 |
\hrule |
| 202 |
|
| 203 |
\medskip |
| 204 |
|
| 205 |
\TableauDocumentation |
| 206 |
|
| 207 |
\medskip |
| 208 |
|
| 209 |
\hrule |
| 210 |
|
| 211 |
\medskip |
| 212 |
|
| 213 |
\newpage |
| 214 |
|
| 215 |
\phantomsection |
| 216 |
\hypertarget{matoc}{} |
| 217 |
|
| 218 |
\tableofcontents |
| 219 |
|
| 220 |
\vfill |
| 221 |
|
| 222 |
\part{Historique} |
| 223 |
|
| 224 |
\verb|v0.1.1|~:~~~~Ajout d'une clé \Cle{[TaillePolice]} + Points définis par une transformation simple. |
| 225 |
|
| 226 |
\verb|v0.1.0|~:~~~~Version initiale. |
| 227 |
|
| 228 |
\newpage |
| 229 |
|
| 230 |
\part{Introduction} |
| 231 |
|
| 232 |
\section{Le package tikz2d-fr} |
| 233 |
|
| 234 |
\subsection{Introduction} |
| 235 |
|
| 236 |
\begin{noteblock} |
| 237 |
Le package propose des commandes basiques -- francisées -- pour travailler sur des figures simples en 2D, à l'aide de \TikZ{} avec : |
| 238 |
|
| 239 |
\begin{itemize} |
| 240 |
\item de quoi simuler un tracé à \textit{main levée} ; |
| 241 |
\item de quoi définir des points (et donc des nœuds) via \textsf{nom/coordonnées/positionlabel} ; |
| 242 |
\item \cmaj{0.1.1} de quoi définir des points images par des transformations simples ; |
| 243 |
\item de marquer des points (croix, disques) ; |
| 244 |
\item de quoi tracer des segments (enchaînés ou non) en spécifiant les couleurs éventuelles. |
| 245 |
\end{itemize} |
| 246 |
\vspace*{-\baselineskip}\leavevmode |
| 247 |
\end{noteblock} |
| 248 |
|
| 249 |
\begin{importantblock} |
| 250 |
On peut voir ce modeste package comme un \textit{maigre} complément à \TikZ{} et \textsf{tkz-euclide}\footnotemark\footnotetext{\url{https://ctan.org/pkg/tkz-euclide}} qui permet de faire énormément de choses en géométrie euclidienne. |
| 251 |
|
| 252 |
\smallskip |
| 253 |
|
| 254 |
Ainsi, les éventuel points (nœuds) créés par \textsf{tikz2d-fr} seront réutilisables dans toute commande classique de \TikZ{} ou de \textsf{tkz-euclide}. |
| 255 |
|
| 256 |
\smallskip |
| 257 |
|
| 258 |
On peut donc \textit{utiliser} le package \textsf{tikz2d-fr} comme \textit{base} de travail avant des choses plus poussées ! |
| 259 |
\end{importantblock} |
| 260 |
|
| 261 |
\subsection{Autres solutions} |
| 262 |
|
| 263 |
\begin{importantblock} |
| 264 |
À noter qu'il existe d'autres solutions graphiques, comme : |
| 265 |
|
| 266 |
\begin{itemize} |
| 267 |
\item \textsf{\PSTricks} avec \textsf{pst-eucl}\footnotemark\footnotetext{\url{https://www.ctan.org/pkg/pst-eucl}} ; |
| 268 |
\item \hologo{MetaPost} avec \textsf{ProfCollege} et son environnement \texttt{geometrie}\footnotemark\footnotetext{\url{https://www.ctan.org/pkg/profcollege}}. |
| 269 |
\end{itemize} |
| 270 |
\vspace*{-\baselineskip}\leavevmode |
| 271 |
\end{importantblock} |
| 272 |
|
| 273 |
\subsection{Chargement du package, packages utilisés} |
| 274 |
|
| 275 |
\begin{importantblock} |
| 276 |
Le package se charge, de manière classique, dans le préambule. |
| 277 |
|
| 278 |
Il n'existe pas d'option pour le package, et \texttt{xcolor} n'est pas chargé. |
| 279 |
\end{importantblock} |
| 280 |
|
| 281 |
\begin{DemoCode}[listing only] |
| 282 |
\documentclass{article} |
| 283 |
\usepackage{tikz2d-fr} |
| 284 |
|
| 285 |
\end{DemoCode} |
| 286 |
|
| 287 |
\begin{noteblock} |
| 288 |
\textsf{tikz2d-fr} charge les packages suivantes : |
| 289 |
|
| 290 |
\begin{itemize} |
| 291 |
\item \texttt{tikz}, \texttt{xstring}, \texttt{simplekv}, \texttt{xintexpr} et \texttt{listofitems} ; |
| 292 |
\item les librairies \texttt{\textit{tikz}.decorations} et \texttt{\textit{tikz}.decorations.pathmorphing}. |
| 293 |
\end{itemize} |
| 294 |
|
| 295 |
Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} ou \textsf{xelatex}. |
| 296 |
\end{noteblock} |
| 297 |
|
| 298 |
\vfill~ |
| 299 |
|
| 300 |
\pagebreak |
| 301 |
|
| 302 |
\part{Styles et commandes} |
| 303 |
|
| 304 |
\section{Tracé à main levée} |
| 305 |
|
| 306 |
\subsection{Idée} |
| 307 |
|
| 308 |
\begin{tipblock} |
| 309 |
L'idée est de \textit{proposer} un style \textit{tout prêt} pour simuler un tracé, en \TikZ, à \og main levée \fg. |
| 310 |
|
| 311 |
Il s'agit d'un style \textit{basique} utilisant la librairie \textsf{decorations} avec \textsf{random steps}. |
| 312 |
\end{tipblock} |
| 313 |
|
| 314 |
\begin{DemoCode}[listing only] |
| 315 |
\tikzset{% |
| 316 |
mainlevee/.style args={#1et#2}{% |
| 317 |
decorate,decoration={random steps, segment length=#1,amplitude=#2}}, |
| 318 |
mainlevee/.default={5mm et 0.6pt} |
| 319 |
} |
| 320 |
\end{DemoCode} |
| 321 |
|
| 322 |
\subsection{Utilisation basique} |
| 323 |
|
| 324 |
\begin{cautionblock} |
| 325 |
Il s'agit ni plus ni moins d'un style \TikZ{} à intégrer dans les tracés et constructions \TikZ ! |
| 326 |
|
| 327 |
\smallskip |
| 328 |
|
| 329 |
Pour ce style, deux paramètres peuvent être précisés via \Cle{mainlevee=\#1 et \#2} : |
| 330 |
|
| 331 |
\begin{itemize} |
| 332 |
\item \Cle{\#1} correspond à l'option \textsf{segment length} (longueur des segments \textit{types}) ; |
| 333 |
|
| 334 |
\hfill{}défaut \Cle{5mm} |
| 335 |
\item \Cle{\#2} correspond à l'option \textsf{amplitude} (amplitude maximale de la \textit{déformation}). |
| 336 |
|
| 337 |
\hfill{}défaut \Cle{0.6pt} |
| 338 |
\end{itemize} |
| 339 |
|
| 340 |
Les valeurs \Cle{mainlevee=5mm et 0.6pt} donnent des résultats -- à mon sens -- satisfaisants, mais l'utilisateur pourra modifier à loisir ces paramètres ! |
| 341 |
\end{cautionblock} |
| 342 |
|
| 343 |
\begin{DemoCode}[listing only] |
| 344 |
%la grille a été rajoutée pour la sortie |
| 345 |
\begin{tikzpicture} |
| 346 |
\draw[thick,mainlevee] (0,0) rectangle (4,4) ; |
| 347 |
\end{tikzpicture} |
| 348 |
|
| 349 |
\begin{tikzpicture} |
| 350 |
\draw[thick,mainlevee=5mm et 2pt] (0,0) rectangle (4,4) ; |
| 351 |
\end{tikzpicture} |
| 352 |
|
| 353 |
\begin{tikzpicture} |
| 354 |
\draw[thick,mainlevee=10mm et 3mm] (0,0) rectangle (4,4) ; |
| 355 |
\end{tikzpicture} |
| 356 |
\end{DemoCode} |
| 357 |
|
| 358 |
\begin{DemoCode}[text only] |
| 359 |
\hfill~\begin{tikzpicture} |
| 360 |
\draw[xstep=0.5,ystep=0.5,ultra thin,lightgray] (0,0) grid (4,4); |
| 361 |
\draw[thick,mainlevee] (0,0) rectangle (4,4) ; |
| 362 |
\end{tikzpicture} |
| 363 |
\hspace{1cm} |
| 364 |
\begin{tikzpicture} |
| 365 |
\draw[xstep=0.5,ystep=0.5,ultra thin,lightgray] (0,0) grid (4,4); |
| 366 |
\draw[thick,mainlevee=5mm et 2pt] (0,0) rectangle (4,4) ; |
| 367 |
\end{tikzpicture} |
| 368 |
\hspace{1cm} |
| 369 |
\begin{tikzpicture} |
| 370 |
\draw[xstep=0.5,ystep=0.5,ultra thin,lightgray] (0,0) grid (4,4); |
| 371 |
\draw[thick,mainlevee=10mm et 3mm] (0,0) rectangle (4,4) ; |
| 372 |
\end{tikzpicture} |
| 373 |
\hfill~ |
| 374 |
\end{DemoCode} |
| 375 |
|
| 376 |
\pagebreak |
| 377 |
|
| 378 |
\section{Définir des points par coordonnées} |
| 379 |
|
| 380 |
\subsection{Commandes} |
| 381 |
|
| 382 |
\begin{cautionblock} |
| 383 |
Les commandes \textit{simplifiées} et \textit{francisées} disponibles sont : |
| 384 |
|
| 385 |
\begin{itemize} |
| 386 |
\item \texttt{\textbackslash DefinirPoint} pour définir un point ; |
| 387 |
\item \texttt{\textbackslash DefinirPoints} pour définir des points ; |
| 388 |
\item \texttt{\textbackslash MarquerPoint} pour marquer (matérialiser) un point ; |
| 389 |
\item \texttt{\textbackslash MarquerPoints} pour marquer (matérialiser) des points. |
| 390 |
\end{itemize} |
| 391 |
\vspace*{-\baselineskip}\leavevmode |
| 392 |
\end{cautionblock} |
| 393 |
|
| 394 |
\begin{DemoCode}[listing only] |
| 395 |
\begin{tikzpicture}[options tikz] |
| 396 |
%créer/placer/nommer un point |
| 397 |
\DefinirPoint(*)[clés]{noeud}{coordonnées}<label> |
| 398 |
%créer/placer/nommer plusieurs points, sans modification des labels ! |
| 399 |
\DefinirPoints(*)[clés]{liste} |
| 400 |
%marquer un point |
| 401 |
\MarquerPoint[clés]{point} |
| 402 |
%marquer plusieurs points |
| 403 |
\MarquerPoints[clés]{liste} |
| 404 |
\end{tikzpicture} |
| 405 |
\end{DemoCode} |
| 406 |
|
| 407 |
\subsection{Clés, options et arguments} |
| 408 |
|
| 409 |
\begin{tipblock} |
| 410 |
Les versions étoilées désactivent l'affichage des labels des points. |
| 411 |
|
| 412 |
\smallskip |
| 413 |
|
| 414 |
L'argument optionnel et entre \texttt{[...]} propose les \Cle{clés} suivantes (communes ou spécifiques) : |
| 415 |
|
| 416 |
\begin{itemize} |
| 417 |
\item \Cle{PosLabel} pour préciser la position (francisée) du label pour les points ; \hfill{}défaut : \Cle{b} |
| 418 |
\item \cmaj{0.1.1} \Cle{TaillePolice} pour spécifier la taille de la police du label ; |
| 419 |
|
| 420 |
\hfill{}défaut : \Cle{\textbackslash normalsize} |
| 421 |
\item \Cle{StyleMarque} parmi \Cle{x/o/+} pour spécifier le style de la marque des points ; |
| 422 |
|
| 423 |
\hfill{}défaut : \Cle{o} |
| 424 |
\item \Cle{Math} : booléen pour afficher le label en mode math ; \hfill{}défaut : \Cle{false} |
| 425 |
\item \Cle{TailleMarque} pour spécifier la taille de la marque des points (disque/ croix) ; |
| 426 |
|
| 427 |
\hfill{}défaut : \Cle{2pt} |
| 428 |
\item \Cle{Couleur} pour paramétrer la couleur.\hfill{}défaut : \Cle{black} |
| 429 |
\end{itemize} |
| 430 |
\vspace*{-\baselineskip}\leavevmode |
| 431 |
\end{tipblock} |
| 432 |
|
| 433 |
\begin{tipblock} |
| 434 |
Les positions pour les labels des points sont \textit{francisées} : |
| 435 |
|
| 436 |
\begin{itemize} |
| 437 |
\item \Cle{b} : \texttt{bas} |
| 438 |
\item \Cle{h} : \texttt{haut} |
| 439 |
\item \Cle{g} : \texttt{gauche} |
| 440 |
\item \Cle{d} : \texttt{droite} |
| 441 |
\item \Cle{hg} : \texttt{haut gauche} |
| 442 |
\item \ldots |
| 443 |
\end{itemize} |
| 444 |
\vspace*{-\baselineskip}\leavevmode |
| 445 |
\end{tipblock} |
| 446 |
|
| 447 |
\begin{tipblock} |
| 448 |
De manière un peu plus spécifique : |
| 449 |
|
| 450 |
\begin{itemize} |
| 451 |
\item le \texttt{<label>} pour la commande \texttt{\textbackslash DefinirPoint} est optionnel, et est identique à \texttt{\{nœud\}} ; |
| 452 |
\item la \texttt{\{liste\}} pour la commande \texttt{\textbackslash DefinirPoints} est à donner -- par exemple -- sous la forme \texttt{A/xa,ya/poslabel B/alpha:r/poslabel ...}. |
| 453 |
\end{itemize} |
| 454 |
\vspace*{-\baselineskip}\leavevmode |
| 455 |
\end{tipblock} |
| 456 |
|
| 457 |
\begin{DemoCode}[] |
| 458 |
\begin{tikzpicture} |
| 459 |
\DefinirPoint{A}{0,0} |
| 460 |
\DefinirPoints{B/4,0/ C/3,2/} |
| 461 |
\DefinirPoints[Math]{H_1/-1,2.5/} |
| 462 |
\MarquerPoints{A,B,C,H_1} |
| 463 |
\end{tikzpicture} |
| 464 |
\end{DemoCode} |
| 465 |
|
| 466 |
\begin{DemoCode}[] |
| 467 |
\begin{tikzpicture} |
| 468 |
\DefinirPoints[DecalLabel=1pt,Couleur=blue,Math]{A/0,0/bg B/4,0/bd} |
| 469 |
\DefinirPoints[DecalLabel=1pt,Couleur=red,TaillePolice=\LARGE]{C/3,2/h} |
| 470 |
\MarquerPoints[StyleMarque=x,Couleur=violet]{A} |
| 471 |
\MarquerPoints[Couleur=orange]{B} |
| 472 |
\MarquerPoint[StyleMarque=+,Couleur=red]{C} |
| 473 |
\end{tikzpicture} |
| 474 |
\end{DemoCode} |
| 475 |
|
| 476 |
\pagebreak |
| 477 |
|
| 478 |
\section{Définir des points par transformation} |
| 479 |
|
| 480 |
\subsection{Commandes} |
| 481 |
|
| 482 |
\begin{cautionblock} |
| 483 |
\cmaj{0.1.1} Les commandes \textit{simplifiées} et \textit{francisées} disponibles sont : |
| 484 |
|
| 485 |
\begin{itemize} |
| 486 |
\item \texttt{\textbackslash ImagePoint} pour définir un point par transformation ; |
| 487 |
\item \texttt{\textbackslash ImagesPoints} pour définir des points par transformation. |
| 488 |
\end{itemize} |
| 489 |
\vspace*{-\baselineskip}\leavevmode |
| 490 |
\end{cautionblock} |
| 491 |
|
| 492 |
\begin{noteblock} |
| 493 |
Les \textit{transformations} disponibles sont (l'écriture \textit{mathématique} sert à illustrer la syntaxe \LaTeX{} utilisée) : |
| 494 |
|
| 495 |
\begin{itemize} |
| 496 |
\item les translations glissées $t(A)=A+k\times\vec{u}$ ; |
| 497 |
\item les rotations $r(A)=A+{\text{rot}}(\Omega,\theta)$ ; |
| 498 |
\item les symétries centrales $s(A)=A+{\text{sym}}(I)$. |
| 499 |
\end{itemize} |
| 500 |
\end{noteblock} |
| 501 |
|
| 502 |
\begin{DemoCode}[listing only] |
| 503 |
\begin{tikzpicture}[options tikz] |
| 504 |
%création des points utiles |
| 505 |
\DefinirPoint... \DefinirPoints |
| 506 |
%point défini par une transformation |
| 507 |
\ImagePoint(*)[clés]{formule}<label point> |
| 508 |
%points définis par des transformations, sans modification des labels ! |
| 509 |
\ImagesPoints(*)[clés]{formule § formule § ...} |
| 510 |
\end{tikzpicture} |
| 511 |
\end{DemoCode} |
| 512 |
|
| 513 |
\begin{DemoCode}[listing only] |
| 514 |
\begin{tikzpicture}[options tikz] |
| 515 |
%création des points utiles |
| 516 |
\DefinirPoint... |
| 517 |
%point défini par une translation glissée |
| 518 |
\ImagePoint(*)[clés]{PtArr=PTDep+t(k,DebVect>FinVect)} |
| 519 |
\end{tikzpicture} |
| 520 |
\end{DemoCode} |
| 521 |
|
| 522 |
\hfill |
| 523 |
\begin{tikzpicture} |
| 524 |
\draw[thin,lightgray] (-2,-1) grid (5,3) ; |
| 525 |
\DefinirPoints{A/0,0/} |
| 526 |
\DefinirPoints*{K/-1,1/ L/2,2/} |
| 527 |
\draw[semithick,->,>=latex] (K)--(L) node[midway,sloped,above] {$\vec{u}$} ; |
| 528 |
\ImagePoint[Math]{A'=A+t(1.5,K>L)} |
| 529 |
\draw[semithick,->,>=latex,gray,dashed] (A)--(A') node[midway,sloped,below] {$k\times\vec{u}$} ; |
| 530 |
\MarquerPoints{A,A'} |
| 531 |
\end{tikzpicture} |
| 532 |
\hfill~ |
| 533 |
|
| 534 |
\begin{DemoCode}[listing only] |
| 535 |
\begin{tikzpicture}[options tikz] |
| 536 |
%création des points utiles |
| 537 |
\DefinirPoint... |
| 538 |
%point défini par une rotation |
| 539 |
\ImagePoint{PtArr=PTDep+r(centre,angle)} |
| 540 |
%point défini par une symétrie centrale |
| 541 |
\end{tikzpicture} |
| 542 |
\end{DemoCode} |
| 543 |
|
| 544 |
\hfill |
| 545 |
\begin{tikzpicture} |
| 546 |
\draw[thin,lightgray] (-2,0) grid (4,4) ; |
| 547 |
\DefinirPoint[Math]{Omega}{0,1}<\Omega> |
| 548 |
\DefinirPoint{A}{3,0.5} |
| 549 |
\ImagePoint[Math]{A'=A+r(Omega,55)} |
| 550 |
\draw[semithick,->,>=latex,gray,dashed] (Omega)--(A) ; |
| 551 |
\draw[semithick,->,>=latex,gray,dashed] (Omega)--(A') ; |
| 552 |
\tkzPicAngle["$\mathcolor{gray}{\alpha}$",draw=gray,<->,angle eccentricity=1.2,angle radius=1cm](A,Omega,A') |
| 553 |
\MarquerPoints{Omega,A,A'} |
| 554 |
\end{tikzpicture} |
| 555 |
\hfill~ |
| 556 |
|
| 557 |
\begin{DemoCode}[listing only] |
| 558 |
\begin{tikzpicture}[options tikz] |
| 559 |
%création des points utiles |
| 560 |
\DefinirPoint... |
| 561 |
\ImagePoint{PtArr=PTDep+s(centre)} |
| 562 |
\end{tikzpicture} |
| 563 |
\end{DemoCode} |
| 564 |
|
| 565 |
\hfill |
| 566 |
\begin{tikzpicture} |
| 567 |
\draw[thin,lightgray] (-4,-1) grid (5,2) ; |
| 568 |
\DefinirPoints{A/4,1/ I/0.5,0.5/} |
| 569 |
\ImagePoint[Math]{A'=A+s(I)} |
| 570 |
\draw[semithick,->,>=latex,gray,dashed] (I)--(A) node[midway,sloped] {$/\!/$} ; |
| 571 |
\draw[semithick,->,>=latex,gray,dashed] (I)--(A') node[midway,sloped] {$/\!/$} ; |
| 572 |
\MarquerPoints{A,I,A'} |
| 573 |
\end{tikzpicture} |
| 574 |
\hfill~ |
| 575 |
|
| 576 |
\subsection{Clés, options et arguments} |
| 577 |
|
| 578 |
\begin{tipblock} |
| 579 |
Les versions étoilées désactivent l'affichage des labels des points. |
| 580 |
|
| 581 |
\smallskip |
| 582 |
|
| 583 |
L'argument optionnel et entre \texttt{[...]} propose les \Cle{clés} suivantes (communes ou spécifiques) : |
| 584 |
|
| 585 |
\begin{itemize} |
| 586 |
\item \Cle{PosLabel} pour préciser la position (francisée) du label pour les points ; \hfill{}défaut : \Cle{b} |
| 587 |
\item \Cle{TaillePolice} pour spécifier la taille de la police du label ; |
| 588 |
|
| 589 |
\hfill{}défaut : \Cle{\textbackslash normalsize} |
| 590 |
\item \Cle{StyleMarque} parmi \Cle{x/o/+} pour spécifier le style de la marque des points ; |
| 591 |
|
| 592 |
\hfill{}défaut : \Cle{o} |
| 593 |
\item \Cle{Math} : booléen pour afficher le label en mode math ; \hfill{}défaut : \Cle{false} |
| 594 |
\item \Cle{TailleMarque} pour spécifier la taille de la marque des points (disque/ croix) ; |
| 595 |
|
| 596 |
\hfill{}défaut : \Cle{2pt} |
| 597 |
\item \Cle{Couleur} pour paramétrer la couleur.\hfill{}défaut : \Cle{black} |
| 598 |
\end{itemize} |
| 599 |
\vspace*{-\baselineskip}\leavevmode |
| 600 |
\end{tipblock} |
| 601 |
|
| 602 |
\pagebreak |
| 603 |
|
| 604 |
\begin{noteblock} |
| 605 |
On donne par exemple $A(0;0)$, $B(4;1)$ et $C(3;2)$ et on définit les points : |
| 606 |
% |
| 607 |
\begin{itemize} |
| 608 |
\item $D$ image de $A$ par la translation de vecteur $\overrightarrow{AB}$ ; |
| 609 |
\item $E$ image de $A$ par la translation de vecteur $\overrightarrow{CB}$ ; |
| 610 |
\item $F$ image de $A$ par la translation-glissée de vecteur $2\overrightarrow{DB}$ ; |
| 611 |
\item $G$ image de $F$ par la translation de vecteur $\overrightarrow{BD}$ ; |
| 612 |
\item $K$ image de $G$ par la rotation de centre $F$ et d'angle 90° ; |
| 613 |
\item $L$ image de $B$ par la symétrie centrale de centre $C$ ; |
| 614 |
\item $H_1$ image de $A$ par la translation-glissée de vecteur $-0{,}5\overrightarrow{BA}$. |
| 615 |
\end{itemize} |
| 616 |
\vspace*{-\baselineskip}\leavevmode |
| 617 |
\end{noteblock} |
| 618 |
|
| 619 |
\begin{DemoCode}[tikz lower] |
| 620 |
\draw[thin,lightgray] (-5,-2) grid (8,5) ; |
| 621 |
\DefinirPoints[Math,TaillePolice=\LARGE]{A/0,0/ B/4,1/ C/3,2/} |
| 622 |
\ImagesPoints[TaillePolice=\tiny]{D=C+t(A>B) § E=A+t(C>B) § F=A+t(2,B>C) § G=F+t(B>D) § K=G+r(F,90) § L=B+s(C)} |
| 623 |
\ImagePoint[Math,TaillePolice=\scriptsize]{H_1=A+t(-0.5,B>A)} |
| 624 |
\MarquerPoints{A,B,C,D,E,F,G,K,L} |
| 625 |
\MarquerPoint{H_1} |
| 626 |
\end{DemoCode} |
| 627 |
|
| 628 |
\pagebreak |
| 629 |
|
| 630 |
\section{Tracer des segments} |
| 631 |
|
| 632 |
\subsection{Commandes} |
| 633 |
|
| 634 |
\begin{cautionblock} |
| 635 |
La commande \textit{simplifiée} et \textit{francisée} pour tracer des segments est \texttt{\textbackslash TracerSegments}. |
| 636 |
|
| 637 |
\smallskip |
| 638 |
|
| 639 |
Le fonctionnement de cette commande permet de définir les segments : |
| 640 |
|
| 641 |
\begin{itemize} |
| 642 |
\item sous la forme \texttt{A/B C/D ...} dans le cas de segments \textit{non forcément contigus} ; |
| 643 |
\item sous la forme \texttt{A B C ...} dans le cas de segments \textit{contigus} (avec possibilité de \textit{fermer} le chemin). |
| 644 |
\end{itemize} |
| 645 |
\end{cautionblock} |
| 646 |
|
| 647 |
\begin{DemoCode}[listing only] |
| 648 |
%version liste de segments (AB) et (CD) et ... |
| 649 |
\begin{tikzpicture} |
| 650 |
\TracerSegments[clés]<options tikz>{ptA/ptB ptC/ptD ...} |
| 651 |
\end{tikzpicture} |
| 652 |
|
| 653 |
%version suite de points (AB) et (BC) et ... |
| 654 |
\begin{tikzpicture} |
| 655 |
\TracerSegments[Suite,clés]<options tikz>{ptA ptB ptC ...} |
| 656 |
\end{tikzpicture} |
| 657 |
\end{DemoCode} |
| 658 |
|
| 659 |
\subsection{Clés, options et arguments} |
| 660 |
|
| 661 |
\begin{tipblock} |
| 662 |
Concernant les \textsf{clés}, qui correspondent au premier argument, optionnel et entre \texttt{[...]} (certaines clés sont inactives dans certaines situations\ldots) : |
| 663 |
|
| 664 |
\begin{itemize} |
| 665 |
\item \Cle{Cap} : type de \textit{jointure} pour les segments individuels ;\hfill{}défaut \Cle{round} |
| 666 |
\item \Cle{Join} : type de \textit{jointure} pour les segments enchaînés ;\hfill{}défaut \Cle{miter} |
| 667 |
\item \Cle{Couleurs} : sous la forme \Cle{couleur unique} ou \Cle{liste,de,couleurs} (cohérente avec le nombre de segments !) ; |
| 668 |
|
| 669 |
\hfill{}défaut \Cle{black} |
| 670 |
\item \Cle{Cycle} : booléen pour préciser qu'on veut \textit{fermer} le chemin ;\hfill{}défaut \Cle{false} |
| 671 |
\item \Cle{Suite} : booléen pour préciser qu'on veut travaille avec des points enchaînés. |
| 672 |
|
| 673 |
\hfill{}défaut \Cle{false} |
| 674 |
\end{itemize} |
| 675 |
\vspace*{-\baselineskip}\leavevmode |
| 676 |
\end{tipblock} |
| 677 |
|
| 678 |
\begin{tipblock} |
| 679 |
Le deuxième argument, optionnel et entre \texttt{<...>} correspond aux options, en langage \TikZ{} à passer à l'ensemble des segments. |
| 680 |
|
| 681 |
\smallskip |
| 682 |
|
| 683 |
Le troisième argument, obligatoire et entre \texttt{\{...\}} correspond à la suite des segments à tracer : |
| 684 |
|
| 685 |
\begin{itemize} |
| 686 |
\item sous la forme \texttt{ptA/ptB ptC/ptD ...} pour des segments individuels ; |
| 687 |
\item sous la forme \texttt{ptA ptB ptC ...} (avec la clé \Cle{Suite}) pour des segments enchaînés. |
| 688 |
\end{itemize} |
| 689 |
\vspace*{-\baselineskip}\leavevmode |
| 690 |
\end{tipblock} |
| 691 |
|
| 692 |
\begin{noteblock} |
| 693 |
À noter que dans le cas d'une succession de segments (\Cle{Suite}) monochromes, cela revient à un chemin et donc ce sera la clé \Cle{Join=...} qui sera utile. |
| 694 |
\end{noteblock} |
| 695 |
|
| 696 |
\pagebreak |
| 697 |
|
| 698 |
\begin{DemoCode}[] |
| 699 |
\begin{tikzpicture} |
| 700 |
\TracerSegments[Suite,Couleurs={red,blue,green}]{0,0 4,0 1,3 0,0} |
| 701 |
\end{tikzpicture} |
| 702 |
\begin{tikzpicture} |
| 703 |
\TracerSegments[Suite,Cap=butt,Couleurs={red,blue,green}]{0,0 4,0 1,3 0,0} |
| 704 |
\end{tikzpicture} |
| 705 |
\begin{tikzpicture} |
| 706 |
\TracerSegments[Suite,Cap=rect,Couleurs={red,blue,green}]{0,0 4,0 1,3 0,0} |
| 707 |
\end{tikzpicture} |
| 708 |
\end{DemoCode} |
| 709 |
|
| 710 |
\begin{DemoCode}[] |
| 711 |
\begin{tikzpicture} |
| 712 |
\TracerSegments[Cycle,Suite,Couleurs=blue,Join=round]{0,0 4,0 1,3} |
| 713 |
\end{tikzpicture} |
| 714 |
\begin{tikzpicture} |
| 715 |
\TracerSegments[Couleurs={red,blue,green}]{0,0/4,0 1,3/0,0 4,0/1,3} |
| 716 |
\end{tikzpicture} |
| 717 |
\begin{tikzpicture} |
| 718 |
\TracerSegments[Suite,Couleurs={yellow,orange}]{0,0 4,0 1,3} |
| 719 |
\end{tikzpicture} |
| 720 |
\end{DemoCode} |
| 721 |
|
| 722 |
\begin{DemoCode}[] |
| 723 |
\begin{tikzpicture} |
| 724 |
\DefinirPoints[DecalLabel=1pt]{A/0,0/bg B/4,0/bd C/3,2/h} |
| 725 |
\TracerSegments[Suite,Cycle,Couleurs={red,blue,green}]{A B C} |
| 726 |
\MarquerPoints[StyleMarque=x]{A,B,C} |
| 727 |
\end{tikzpicture} |
| 728 |
\begin{tikzpicture} |
| 729 |
\DefinirPoints[DecalLabel=1pt,Math]{A/0,0/bg B/4,0/bd C/3,2/h} |
| 730 |
\TracerSegments[Couleurs={yellow,red}]{A/B B/C} |
| 731 |
\TracerSegments[Couleurs=blue]{C/A} |
| 732 |
\MarquerPoints{A,B,C} |
| 733 |
\end{tikzpicture} |
| 734 |
\end{DemoCode} |
| 735 |
|
| 736 |
\end{document} |