diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.pdf | bin | 0 -> 383232 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.tex | 792 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/outilsgeomtikz/README.md | 7 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/outilsgeomtikz/OutilsGeomTikz.sty | 620 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-pictures.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/outilsgeomtikz.tlpsrc | 0 |
6 files changed, 1420 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.pdf b/Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.pdf Binary files differnew file mode 100644 index 00000000000..9a62f0d5154 --- /dev/null +++ b/Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.pdf diff --git a/Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.tex b/Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.tex new file mode 100644 index 00000000000..a2e0c58b231 --- /dev/null +++ b/Master/texmf-dist/doc/latex/outilsgeomtikz/OutilsGeomTikz-doc.tex @@ -0,0 +1,792 @@ +% !TeX TXS-program:compile = txs:///arara +% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} +% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') + +\documentclass[french,a4paper,11pt]{article} +\usepackage[margin=2cm,includefoot]{geometry} +\def\TPversion{0.1.0} +\def\TPdate{03 Mars 2023} +\usepackage[table,svgnames]{xcolor} +\usepackage[bold-style=ISO,math-style=french]{concmath-otf} +%\usepackage[bold-style=ISO,math-style=french]{unicode-math} +%\setmainfont{TeX Gyre Schola} +%\setmathfont{TeX Gyre Schola Math} +\usepackage{OutilsGeomTikz} +\usepackage{awesomebox} +\usepackage{fontawesome5} +\usepackage{footnote} +\makesavenoteenv{tabular} +\usepackage{enumitem} +\usepackage{tabularray} +\usepackage{multicol} +\usepackage{fancyvrb} +\usepackage{fancyhdr} +\usepackage{siunitx} +\sisetup{locale=FR,output-decimal-marker={,},group-minimum-digits=4} +\pagestyle{fancy} +\fancyhf{} +\renewcommand{\headrulewidth}{0pt} +\lfoot{\sffamily\small [OutilsGeomTikz]} +\cfoot{\sffamily\small - \thepage{} -} +\rfoot{} +\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} + +\usepackage{hologo} +\providecommand\tikzlogo{Ti\textit{k}Z} +\providecommand\TeXLive{\TeX{}Live\xspace} +\providecommand\PSTricks{\textsf{PSTricks}\xspace} +\let\pstricks\PSTricks +\let\TikZ\tikzlogo +\newcommand\TableauDocumentation{% + \begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} + {\LARGE \LaTeX} & & & & &\\ + & {\LARGE \hologo{pdfLaTeX}} & & & & \\ + & & {\LARGE \hologo{LuaLaTeX}} & & & \\ + & & & {\LARGE \TikZ} & & \\ + & & & & {\LARGE \TeXLive} & \\ + & & & & & {\LARGE \hologo{MiKTeX}} \\ + \end{tblr} +} + +\usepackage{hyperref} +\urlstyle{same} +\hypersetup{pdfborder=0 0 0} +\setlength{\parindent}{0pt} +\definecolor{LightGray}{gray}{0.9} + +\usepackage[french]{babel} +\AddThinSpaceBeforeFootnotes +\FrenchFootnotes + +\usepackage[most]{tcolorbox} +\usetikzlibrary{calc} +\tcbuselibrary{minted} +\NewTCBListing{PresentationCode}{ O{blue} m }{% + sharp corners=downhill,enhanced,arc=12pt,skin=bicolor,% + colback=#1!1!white,colframe=#1!75!black,colbacklower=white,% + attach boxed title to top right={yshift=-\tcboxedtitleheight},title=Code \LaTeX,% + boxed title style={% + colframe=#1!75!black,colback=#1!15!white,% + ,sharp corners=downhill,arc=12pt,% + },% + top=\baselineskip,% + fonttitle=\color{#1!90!black}\itshape\ttfamily\footnotesize,% + listing engine=minted,minted style=colorful, + minted language=tex,minted options={tabsize=2,fontsize=\small,autogobble,breaklines=true}, + #2 +} + +\tcbset{vignettes/.style={% + nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,% + boxrule=0.75pt,left=7pt,right=1pt,top=0pt,bottom=0.25pt,% + } +} + +\tcbset{vignetteMaJ/.style={% + fontupper={\vphantom{pf}\footnotesize\ttfamily}, + vignettes,colframe=ForestGreen!50!black,coltitle=white,colback=ForestGreen!25,% + overlay={\begin{tcbclipinterior}% + \fill[fill=ForestGreen!75]($(interior.south west)$) rectangle node[rotate=90]{\tiny \sffamily{\textcolor{Black}{\scalebox{0.85}[0.75]{\textbf{MàJ}}}}} ($(interior.north west)+(5pt,0pt)$);% + \end{tcbclipinterior}} + } +} + +\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}} +\newcommand\cmaj[1]{\tcbox[vignetteMaJ]{#1}\xspace} + +\newcommand\affichegrille[4]{% + \draw[xstep=1,ystep=1,lightgray] (#1,#3) grid (#2,#4) ; + \foreach \x in {#1,\inteval{1+#1},...,#2} \draw[lightgray] (\x,#4)--++(0,3pt) node[font=\scriptsize,above] {$\x$} ; + \foreach \y in {#3,\inteval{1+#3},...,#4} \draw[lightgray] (#1,\y)--++(-3pt,0) node[font=\scriptsize,left] {$\y$} ; +} +\newcommand\pointsutiles[1]{% + \foreach \point in {#1} {\draw[thick,fill=red] \point circle[radius=3pt] ;} +} + +\begin{document} + +\setlength{\aweboxleftmargin}{0.07\linewidth} +\setlength{\aweboxcontentwidth}{0.93\linewidth} +\setlength{\aweboxvskip}{8pt} + +\thispagestyle{empty} + +\vspace{2cm} + +\begin{center} + \begin{minipage}{0.75\linewidth} + \begin{tcolorbox}[colframe=yellow,colback=yellow!15] + \begin{center} + \begin{tabular}{c} + {\Huge \texttt{OutilsGeomTikz [fr]}}\\ + \\ + {\LARGE Des outils géométriques, } \\ + \\ + {\LARGE en Ti\textit{k}Z}. \\ + \end{tabular} + + \bigskip + + {\small \texttt{Version \TPversion{} -- \TPdate}} + \end{center} + \end{tcolorbox} +\end{minipage} +\end{center} + +\begin{center} + \begin{tabular}{c} + \texttt{Cédric Pierquet}\\ + {\ttfamily c pierquet -- at -- outlook . fr}\\ + \texttt{\url{https://github.com/cpierquet/OutilsGeomTikz}} +\end{tabular} +\end{center} + +\vspace{0.25cm} + +{$\blacktriangleright$~~Des outils géométriques, personnalisables, en Ti\textit{k}Z.} + +\smallskip + +{$\blacktriangleright$~~Une règle, un rapporteur, une équerre, une réquerre, un rappéquerre, un crayon, un compas.} + +\vspace{0.5cm} + +\hfill +\begin{tikzpicture} + \tkzRegle[Fond,AfficheValeurs,Longueur=15,Rotation=-20,Echelle=0.5,CouleurFond=blue] + \tkzEquerre + [Fond,AfficheValeurs,Longueur=12,Origine={(-20:4)},Rotation=-20,CouleurFond=red,Echelle=0.5] + \tkzCrayon[Couleur=ForestGreen,Origine={(-20:4)},Rotation=30,Echelle=0.5] + \draw (10,-5)--++(20:5) (10,-5)--++(50:5) ; + \tkzRapporteur[Fond,CouleurFond=purple,Origine={(10,-5)},Echelle=0.5,Rotation=20] + \tkzRappEquerre[Fond,Origine={(8,1)},Rotation=90,CouleurFond=ForestGreen,Echelle=0.5] + \tkzCrayon[Couleur=yellow,Origine={(8,-1)},Rotation=20,Echelle=0.5] + \coordinate (AA) at ($(10,-5)+(50:{0.5*3.75})$) ; + \tkzCrayon[Couleur=orange,Origine={AA},Rotation=-20,Echelle=0.5] + \tkzRequerre[Fond,AfficheValeurs,CouleurFond=yellow,Origine={(3,-3)},Rotation=-30,Echelle=0.5] + \tkzCrayon[Couleur=gray,Origine={(3,-3)},Rotation=-98,Echelle=0.5] + %compas + \coordinate (FG) at (0,1) ; \coordinate (FH) at (2,1.5) ; + \tkzCompas[LongueurBranches=3,EchelleCrayon=0.75]{FG}{FH} + \tkzRapporteur[Complet,Echelle=0.5,Origine={(13,3.25)},Rotation=25,Fond,CouleurFond=orange] +\end{tikzpicture}\hfill~ + +%\vspace{0.5cm} +% +%\hfill{}\textit{Merci à Denis Bitouzé et à Gilles Le Bourhis pour leurs retours et idées !} + +\smallskip + +\vfill + +\hrule + +\medskip + +\TableauDocumentation + +\medskip + +\hrule + +\medskip + +\newpage + +\phantomsection +\hypertarget{matoc}{} + +\tableofcontents + +\vfill + +\part{Historique} + +\verb|v0.1.0|~:~~~~Version initiale. + +\vspace{1cm} + +\newpage + +\part{Introduction} + +\section{Le package OutilsGeomTikz} + +\subsection{Introduction} + +\begin{noteblock} +Le package \textsf{OutilsGeomTikz} \textit{propose} des éléments graphiques, en langage \TikZ, pour présenter des outils de construction classiques et personnalisables : + +\begin{itemize} + \item un crayon ; + \item une règle graduée ; + \item une équerre graduée (30/60) ; + \item un rapporteur (180 ou 360); + \item une réquerre graduée ; + \item une \og rappéquerre \fg{} graduée ; + \item un compas. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{noteblock} + +\begin{cautionblock} +Certaines idées et \textit{donc} certains \textit{morceaux} de codes proviennent de Stéphane Pasquet\footnotemark\footnotetext{\url{https://tex.stackexchange.com/questions/147389/symbols-of-pencil-ruler-and-compass}} sur un fil de discussion en ligne. +\end{cautionblock} + +\subsection{Chargement du package, packages utilisés} + +\begin{importantblock} +Le package se charge, dans le préambule, de manière classique. + +Pas d'\textit{option} pour le package, qui ne nécessite que \textit{peu} de dépendances ! +\end{importantblock} + +\begin{PresentationCode}{listing only} +\usepackage{OutilsGeomTikz} +\end{PresentationCode} + +\begin{noteblock} +\textsf{OutilsGeomTikz} charge les packages et librairies suivants : + +\begin{itemize} + \item \texttt{tikz}, \texttt{pgffor}, \texttt{simplekv}, \texttt{nicefrac} et \texttt{xstring} ; + \item \texttt{\textit{tikz}.calc}, \texttt{\textit{tikz}.positioning}. +\end{itemize} + +Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} ou \textsf{xelatex}. +\end{noteblock} + +\subsection{Autres solutions} + +\begin{noteblock} +D'autres solutions existent pour présenter des outils géométriques, notamment \textsf{pst-geometrictools}\footnotemark\footnotetext{disponible sur le CTAN : \url{https://ctan.org/pkg/pst-geometrictools}.} (avec du code \PSTricks) ou \textsf{tkz-tools}\footnotemark\footnotetext{disponible sur son site : \url{https://www.mathweb.fr/euclide/les-packages-personnels-latex-stephane-pasquet/}.}, dont \textsf{OutilsGeomTikz} reprend quelques éléments de base ! + +\smallskip + +L'utilisateur utilisera la solution la mieux adaptée pour ses besoins ! +\end{noteblock} + +\pagebreak + +\section{Philosophie du package} + +\subsection{Fonctionnement global} + +\begin{tipblock} +Les différents outils disponibles ont \textit{grosso-modo} le même mode de fonctionnement : + +\begin{itemize} + \item le \textit{nom} de la commande est sous la forme \texttt{\textbackslash tkz<Outil>} ; + \item les outils ont été créés, en \TikZ, avec comme unité de base le centimètre ; + \item pour certains outils, des dimensions minimales sont requises pour un aspect conforme et acceptable ; + \item les options personnalisables sont (sauf exceptions) : + \begin{itemize} + \item la \textit{taille} ; + \item l'\textit{échelle} globale ou l'\textit{échelle} des éventuels labels ; + \item les \textit{couleurs} ; + \item le \textit{fond} (couleur et opacité) ; + \item la position (\textit{placement} et/ou \textit{rotation}). + \end{itemize} +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\subsection{Liste des commandes} + +\begin{cautionblock} +Les outils disponibles sont à insérer dans un environnement \TikZ, et pour le moment il existe : +\begin{itemize} + \item \texttt{\textbackslash tkzRegle} ; + \item \texttt{\textbackslash tkzEquerre} ; + \item \texttt{\textbackslash tkzRapporteur} ; + \item \texttt{\textbackslash tkzRequerre} ; + \item \texttt{\textbackslash tkzRappequerre} ; + \item \texttt{\textbackslash tkzCompas} ; + \item \texttt{\textbackslash tkzCrayon}. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{cautionblock} + +\begin{PresentationCode}{listing only} +\tkzRegle[clés] +\tkzEquerre[clés] +\tkzRapporteur[clés] +\tkzRequerre[clés] +\tkzRappEquerre[clés] +\tkzCrayon[clés] +\tkzCompas[clés]{pointe}{mine} +\end{PresentationCode} + +\subsection{Utilisation d'unités} + +\begin{tipblock} +Les outils ont été créés avec unité de base de 1~cm, afin que les graduations soient \textit{en taille réelle}. + +\smallskip + +Il est toutefois possible de modifier les unités de l'environnement \TikZ, dans ce cas les graduations des outils ne seront plus forcément en adéquation avec les unités choisies. + +\smallskip + +Ce choix est donc à \textit{réserver} dans l'optique de faire des petits schémas pour illustrer des positions d'outils. +\end{tipblock} + +\pagebreak + +\part{Les outils} + +\section{Le crayon} + +\subsection{La commande} + +\begin{cautionblock} +Le package propose l'outil \textsf{Crayon}. + +La forme générale du crayon est \textit{fixée}, mais le crayon peut être \textit{personnalisé}. +\end{cautionblock} + +\begin{PresentationCode}{tikz lower} +\tkzCrayon +\end{PresentationCode} + +\subsection{Clés et options} + +\begin{tipblock} +Quelques \Cle{clés} de personnalisation sont disponibles : + +\begin{itemize} + \item \Cle{Longueur} pour la taille, en cm, du crayon ;\hfill~(défaut : \Cle{5} et mini \Cle{2.5}) + \item \Cle{Origine} pour le placer le crayon (au niveau du $0$) ;\hfill~(défaut : \Cle{\{(0,0)\}}) + \item \Cle{Rotation} pour pivoter le crayon (au niveau de la mine) ;\hfill~(défaut : \Cle{0}) + \item \Cle{Echelle} pour l'échelle globale le crayon ;\hfill~(défaut : \Cle{1}) + \item \Cle{Couleur} pour la couleur du crayon.\hfill~(défaut : \Cle{red}) +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{noteblock} +Pour des exemples de personnalisation, une grille ainsi que les points \textit{support} seront rajoutés. + +\smallskip + +Toutes les \Cle{clés} ne seront pas présentées de manière indépendante, mais parfois elles seront \textit{cumulées} pour éviter de surcharger la sortie. +\end{noteblock} + +\begin{PresentationCode}{listing only} +%environnement tikz +\tkzCrayon[Origine={(-3,-2)},Echelle=0.75,Rotation=45,Couleur=DarkBlue] +\tkzCrayon[Origine={(1,-4)},Longueur=10,Rotation=-30,Couleur=Green] +\tkzCrayon[Origine={(-3,3)},Echelle=1.25,Rotation=195,Couleur=orange] +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-7}{7}{-5}{5} + \pointsutiles{(-3,-2),(1,-4),(-3,3)} + \tkzCrayon[Origine={(-3,-2)},Echelle=0.75,Rotation=45,Couleur=DarkBlue] + \tkzCrayon[Origine={(1,-4)},Longueur=10,Rotation=-30,Couleur=Green] + \tkzCrayon[Origine={(-3,3)},Echelle=1.25,Rotation=195,Couleur=orange] +\end{tikzpicture} +\end{PresentationCode} + +\pagebreak + +\section{La règle graduée} + +\subsection{La commande} + +\begin{cautionblock} +Le package propose l'outil \textsf{Règle graduée}. + +La forme générale de la règle est \textit{fixée}, mais la règle peut être \textit{personnalisée}. +\end{cautionblock} + +\begin{PresentationCode}{tikz lower} +\tkzRegle +\end{PresentationCode} + +\subsection{Clés et options} + +\begin{tipblock} +Quelques \Cle{clés} de personnalisation sont disponibles : + +\begin{itemize} + \item \Cle{Longueur} pour la taille, en cm, de la règle ;\hfill~(défaut : \Cle{12} et mini \Cle{3}) + \item \Cle{Largeur} pour la largeur, en cm, de la règle ;\hfill~(défaut : \Cle{1.5} et mini \Cle{1.25}) + \item \Cle{Origine} pour le placer la règle (au niveau du $0$) ;\hfill~(défaut : \Cle{\{(0,0)\}}) + \item \Cle{Rotation} pour pivoter la règle (au niveau du $0$) ;\hfill~(défaut : \Cle{0}) + \item \Cle{Echelle} pour l'échelle globale de la règle ;\hfill~(défaut : \Cle{1}) + \item \Cle{Couleur} pour la couleur des éléments de la règle ;\hfill~(défaut : \Cle{black}) + \item le booléen \Cle{Fond} pour afficher une couleur de fond pour la règle ;\hfill~(défaut : \Cle{false}) + \item \Cle{CouleurFond} pour la couleur du fond de la règle ;\hfill~(défaut : \Cle{black}) + \item \Cle{Opacite} pour régler l'opacité du fond de la règle ;\hfill~(défaut : \Cle{0.5}) + \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations ;\hfill~(défaut : \Cle{true}) + \item \Cle{PosVal} pour spécifier la position (haut, milieu, etc) des valeurs, parmi \Cle{h/m/b/hb}. + + \hfill~(défaut : \Cle{m}) +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{noteblock} +Pour des exemples de personnalisation, une grille ainsi que les points \textit{support} seront rajoutés. + +\smallskip + +Toutes les \Cle{clés} ne seront pas présentées de manière indépendante, mais parfois elles seront \textit{cumulées} pour éviter de surcharger la sortie. +\end{noteblock} + +\begin{PresentationCode}{listing only} +%environnement tikz +\tkzRegle[Fond,CouleurFond=red] +\tkzRegle[Longueur=13,Largeur=2,Rotation=-45,Couleur=ForestGreen, Origine={(1,-3)},Fond,PosVal=hb] +\tkzRegle[Largeur=1.25,Longueur=9,Couleur=blue,Rotation=20,Origine={(0,3)}, AfficheValeurs=false] +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-1}{13}{-14}{7} + \pointsutiles{(0,0),(1,-3),(0,3)} + \tkzRegle[Fond,CouleurFond=red] + \tkzRegle[Longueur=13,Largeur=2,Rotation=-45,Couleur=ForestGreen,Origine={(1,-3)},Fond,PosVal=hb] + \tkzRegle[Largeur=1.25,Longueur=9,Couleur=blue,Rotation=20,Origine={(0,3)},AfficheValeurs=false] +\end{tikzpicture} +\end{PresentationCode} + +\pagebreak + +\section{L'équerre} + +\subsection{La commande} + +\begin{cautionblock} +Le package propose l'outil \textsf{Équerre}. + +La forme générale de l'équerre (angles 60/30) est \textit{fixée}, mais l'équerre peut être \textit{personnalisée}. +\end{cautionblock} + +\begin{PresentationCode}{tikz lower} +\tkzEquerre +\end{PresentationCode} + +\subsection{Clés et options} + +\begin{tipblock} +Quelques \Cle{clés} de personnalisation sont disponibles : + +\begin{itemize} + \item \Cle{Longueur} pour la longueur, en cm, de l'équerre ;\hfill~(défaut : \Cle{10} et mini \Cle{4.5}) + \item \Cle{Origine} pour le placer l'équerre (au niveau du coin) ;\hfill~(défaut : \Cle{\{(0,0)\}}) + \item \Cle{Rotation} pour pivoter l'équerre (au niveau du coin) ;\hfill~(défaut : \Cle{0}) + \item \Cle{Echelle} pour l'échelle globale de l'équerre ;\hfill~(défaut : \Cle{1}) + \item \Cle{Couleur} pour la couleur des éléments de l'équerre ;\hfill~(défaut : \Cle{black}) + \item le booléen \Cle{Fond} pour afficher une couleur de fond pour l'équerre ;\hfill~(défaut : \Cle{false}) + \item \Cle{CouleurFond} pour la couleur du fond de l'équerre ;\hfill~(défaut : \Cle{black}) + \item \Cle{Opacite} pour régler l'opacité du fond de l'équerre ;\hfill~(défaut : \Cle{0.5}) + \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations.\hfill~(défaut : \Cle{true}) +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresentationCode}{listing only} +%environnement tikz +\tkzEquerre[Fond] +\tkzEquerre[Echelle=0.5,Origine={(8,6)},Couleur=DarkBlue,Rotation=-45] +\tkzEquerre[Longueur=10,Origine={(2.5,-1)},Couleur=red,Rotation=-105] +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-1}{13}{-7}{11} + \pointsutiles{(0,0),(8,6),(2.5,-1)} + \tkzEquerre[Fond] + \tkzEquerre[Echelle=0.5,Origine={(8,6)},Couleur=DarkBlue,Rotation=-45] + \tkzEquerre[Longueur=10,Origine={(2.5,-1)},Couleur=red,Rotation=-105] +\end{tikzpicture} +\end{PresentationCode} + +\pagebreak + +\section{Les rapporteurs (180 \&{} 360)} + +\subsection{La commande} + +\begin{cautionblock} +Le package propose l'outil \textsf{Rapporteur}. + +La forme générale du rapporteur (largeur $7,5$~cm) est \textit{fixée}, mais le rapporteur peut être \textit{personnalisé}. +\end{cautionblock} + +\begin{PresentationCode}{tikz lower} +\tkzRapporteur +\end{PresentationCode} + +\begin{PresentationCode}{tikz lower} +\tkzRapporteur[Complet] +\end{PresentationCode} + +\subsection{Clés et options} + +\begin{tipblock} +Quelques \Cle{clés} de personnalisation sont disponibles : + +\begin{itemize} + \item le booléen \Cle{Complet} pour afficher la version \og 360 \fg{};\hfill~(défaut : \Cle{false}) + \item \Cle{Origine} pour le placer le rapporteur (au niveau du \textit{centre}) ;\hfill~(défaut : \Cle{\{(0,0)\}}) + \item \Cle{Rotation} pour pivoter le rapporteur (au niveau du \textit{centre}) ;\hfill~(défaut : \Cle{0}) + \item \Cle{Echelle} pour l'échelle globale du rapporteur ;\hfill~(défaut : \Cle{1}) + \item \Cle{Couleur} pour la couleur des éléments du rapporteur ;\hfill~(défaut : \Cle{black}) + \item le booléen \Cle{Fond} pour afficher une couleur de fond ;\hfill~(défaut : \Cle{false}) + \item \Cle{CouleurFond} pour la couleur du fond du rapporteur ;\hfill~(défaut : \Cle{black}) + \item \Cle{Opacite} pour régler l'opacité du fond du rapporteur ;\hfill~(défaut : \Cle{0.5}) + \item le booléen \Cle{AfficheAngles} pour afficher les valeurs des angles.\hfill~(défaut : \Cle{true}) +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresentationCode}{listing only} +%environnement tikz +\tkzRapporteur[Fond,CouleurFond=purple] +\tkzRapporteur[Origine={(-2,-3)},Rotation=-45,Couleur=ForestGreen,Echelle=0.5] +\tkzRapporteur[Complet,Origine={(8,-3)},Rotation=30,Couleur=DarkBlue, Echelle=0.75] +\tkzRapporteur[Origine={(7,1)},Rotation=15,Couleur=orange, Echelle=0.75,AfficheAngles=false] +\tkzRapporteur[Complet,Origine={(8,-3)},Rotation=30,Couleur=DarkBlue, Echelle=0.75] +\tkzRapporteur[Complet,Origine={(2,-4)},Rotation=-90,Couleur=red, Echelle=0.5,AfficheAngles=false,Fond,CouleurFond=yellow] +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-4}{11}{-6}{4} + \pointsutiles{(0,0),(-2,-3),(8,-3),(7,1),(2,-4)} + \tkzRapporteur[Fond,CouleurFond=purple] + \tkzRapporteur[Origine={(-2,-3)},Rotation=-45,Couleur=ForestGreen,Echelle=0.5] + \tkzRapporteur[Complet,Origine={(8,-3)},Rotation=30,Couleur=DarkBlue, Echelle=0.75] + \tkzRapporteur[Origine={(7,1)},Rotation=15,Couleur=orange, Echelle=0.75,AfficheAngles=false] + \tkzRapporteur[Complet,Origine={(8,-3)},Rotation=30,Couleur=DarkBlue, Echelle=0.75] + \tkzRapporteur[Complet,Origine={(2,-4)},Rotation=-90,Couleur=red,Echelle=0.5,AfficheAngles=false,Fond,CouleurFond=yellow] +\end{tikzpicture} +\end{PresentationCode} + +\pagebreak + +\section{La réquerre} + +\subsection{La commande} + +\begin{cautionblock} +Le package propose l'outil \textsf{Réquerre}. + +La forme générale de la réquerre est \textit{fixée}, mais la réquerre peut être \textit{personnalisée}. +\end{cautionblock} + +\begin{PresentationCode}{tikz lower} +\tkzRequerre +\end{PresentationCode} + +\subsection{Clés et options} + +\begin{tipblock} +Quelques \Cle{clés} de personnalisation sont disponibles : + +\begin{itemize} + \item \Cle{Longueur} pour la taille, en cm, de la réquerre ;\hfill~(défaut : \Cle{12} et mini \Cle{6}) + \item \Cle{Largeur} pour la largeur, en cm, la réquerre ;\hfill~(défaut : \Cle{3} et mini \Cle{1.5}) + \item \Cle{Origine} pour le placer la réquerre (au niveau du \textit{centre}) ;\hfill~(défaut : \Cle{\{(0,0)\}}) + \item \Cle{Rotation} pour pivoter la réquerre (au niveau du coin) ;\hfill~(défaut : \Cle{0}) + \item \Cle{Echelle} pour l'échelle globale de la réquerre ;\hfill~(défaut : \Cle{1}) + \item \Cle{Couleur} pour la couleur des éléments de la réquerre ;\hfill~(défaut : \Cle{black}) + \item le booléen \Cle{Fond} pour afficher une couleur de fond pour la réquerre ;\hfill~(défaut : \Cle{false}) + \item \Cle{CouleurFond} pour la couleur du fond de la réquerre ;\hfill~(défaut : \Cle{black}) + \item \Cle{Opacite} pour régler l'opacité du fond de la réquerre ;\hfill~(défaut : \Cle{0.5}) + \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations.\hfill~(défaut : \Cle{true}) +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresentationCode}{listing only} +%environnement tikz +\tkzRequerre[Fond,CouleurFond=yellow] +\tkzRequerre[Echelle=0.5,Origine={(-5,-6)},Rotation=-80,Couleur=ForestGreen, Longueur=10,Largeur=3.5,AfficheValeurs=false] +\tkzRequerre[Origine={(1,-5)},Rotation=15,Couleur=DarkBlue, Longueur=9,Largeur=2.75] +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-8}{7}{-9}{1} + \pointsutiles{(0,0),(-5,-6),(1,-5)} + \tkzRequerre[Fond,CouleurFond=yellow] + \tkzRequerre[Echelle=0.5,Origine={(-5,-6)},Rotation=-80,Couleur=ForestGreen, Longueur=10,Largeur=3.5,AfficheValeurs=false] + \tkzRequerre[Origine={(1,-5)},Rotation=15,Couleur=DarkBlue,Longueur=9,Largeur=2.75] +\end{tikzpicture} +\end{PresentationCode} + +\pagebreak + +\section{La \og rappéquerre \fg} + +\subsection{La commande} + +\begin{cautionblock} +Le package propose l'outil \textsf{RappÉquerre}. + +La forme générale de la rappéquerre est \textit{fixée}, mais la rappéquerre peut être \textit{personnalisée}. +\end{cautionblock} + +\begin{PresentationCode}{tikz lower} +\tkzRappEquerre +\end{PresentationCode} + +\subsection{Clés et options} + +\begin{tipblock} +Quelques \Cle{clés} de personnalisation sont disponibles : + +\begin{itemize} + \item \Cle{Largeur} pour la (demie-)largeur, en cm, de la rappéquerre ;\hfill~(défaut : \Cle{6} et mini \Cle{3}) + \item \Cle{Origine} pour le placer la rappéquerre (au niveau du coin) ;\hfill~(défaut : \Cle{\{(0,0)\}}) + \item \Cle{Rotation} pour pivoter la rappéquerre (au niveau du coin) ;\hfill~(défaut : \Cle{0}) + \item \Cle{Echelle} pour l'échelle globale de la rappéquerre ;\hfill~(défaut : \Cle{1}) + \item \Cle{EchelleValeurs} pour l'échelle des valeurs ;\hfill~(défaut : \Cle{1}) + \item \Cle{Couleur} pour la couleur des éléments de la rappéquerre ;\hfill~(défaut : \Cle{black}) + \item le booléen \Cle{Fond} pour afficher une couleur de fond pour la rappéquerre ;\hfill~(défaut : \Cle{false}) + \item \Cle{CouleurFond} pour la couleur du fond de la rappéquerre ;\hfill~(défaut : \Cle{black}) + \item \Cle{Opacite} pour régler l'opacité du fond de la rappéquerre ;\hfill~(défaut : \Cle{0.5}) + \item le booléen \Cle{AfficheAngles} pour afficher les valeurs des angles ;\hfill~(défaut : \Cle{true}) + \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations.\hfill~(défaut : \Cle{true}) +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresentationCode}{listing only} +%environnement tikz +\tkzRappEquerre[Fond,Ombre] +\tkzRappEquerre[Origine={(-5,-9)},Rotation=150,Couleur=ForestGreen,Echelle=0.5,Ombre] +\tkzRappEquerre[Origine={(2,-10)},Rotation=-170,Couleur=DarkBlue, Largeur=4,Fond,AfficheValeurs=false,AfficheAngles=false,CouleurFond=DarkBlue] +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-8}{7}{-11}{1} + \pointsutiles{(0,0),(-5,-9),(2,-10)} + \tkzRappEquerre[Fond,Ombre] + \tkzRappEquerre[Origine={(-5,-9)},Rotation=150,Couleur=ForestGreen,Echelle=0.5,Ombre] + \tkzRappEquerre[Origine={(2,-10)},Rotation=-170,Couleur=DarkBlue,Largeur=4,Fond,AfficheValeurs=false,AfficheAngles=false,CouleurFond=DarkBlue] +\end{tikzpicture} +\end{PresentationCode} + +\pagebreak + +\section{Le compas} + +\subsection{La commande} + +\begin{cautionblock} +Le package propose l'outil \textsf{Compas}. + +L'aspect général du compas est \textit{fixé}, mais le compas peut être \textit{personnalisé}. +\end{cautionblock} + +\begin{PresentationCode}{tikz lower} +\coordinate (A) at (0,0) ; +\coordinate (B) at (2.5,0) ; +\tkzCompas{A}{B} +\end{PresentationCode} + +\subsection{Arguments, clés et options} + +\begin{tipblock} +Les deux arguments \textit{obligatoires} sont les \textbf{nœuds} de la pointe et de la mine du compas, donnés par exemple grâce aux commandes \texttt{\textbackslash coordinate} ou \texttt{\textbackslash node}. + +\medskip + +Quelques \Cle{clés} de personnalisation sont disponibles : + +\begin{itemize} + \item le booléen \Cle{AfficheCrayon} pour afficher le crayon ;\hfill~(défaut : \Cle{true}) + \item \Cle{EchelleCrayon} pour l'échelle du crayon ;\hfill~(défaut : \Cle{1}) + \item \Cle{CouleurCrayon} pour la couleur du crayon ;\hfill~(défaut : \Cle{red}) + \item \Cle{LongueurCrayon} pour la longueur du crayon ;\hfill~(défaut : \Cle{5}) + \item \Cle{LongueurBranches} pour la taille des branches du compas ;\hfill~(défaut : \Cle{6}) + \item le booléen \Cle{CouleurCompas} pour la couleur du compas ;\hfill~(défaut : \Cle{gray}) + \item le booléen \Cle{Retourne} pour forcer le retournement \og horizontal \fg{} du compas ; + + \hfill~(défaut : \Cle{false}) + \item \Cle{Echelle} pour l'échelle du compas (à utiliser avec précaution\ldots) ;\hfill~(défaut : \Cle{1}) + \item \Cle{UniteTikz} (à utiliser avec précaution\ldots) pour spécifier une unité, par défaut elle est calculée (et stockée) en interne ; + + \hfill~(défaut : \Cle{\textbackslash TmpUniteX}) +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresentationCode}{listing only} +%environnement tikz +\tkzCompas{A}{B} +\tkzCompas[LongueurBranches=4,CouleurCrayon=blue]{C}{D} +\tkzCompas[LongueurBranches=3,CouleurCrayon=orange,Retourne, LongueurCrayon=3,CouleurCompas=black]{F}{E} +\tkzCompas[LongueurBranches=3,CouleurCrayon=Green, LongueurCrayon=3,CouleurCompas=purple]{F}{E} +\tkzCompas[Echelle=0.75,Retourne,CouleurCrayon=cyan,CouleurCompas=pink]{G}{H} +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-6}{9}{-6}{7} + \pointsutiles{(0,0),(2,1),(-4,-5),(-1,-5),(5,-2),(8,-3),(8.5,6),(8.5,2.5)} + \coordinate (A) at (0,0) ; \draw (A) node[below] {A} ; + \coordinate (B) at (2,1) ; \draw (B) node[below] {B} ; + \coordinate (C) at (-4,-5) ; \draw (C) node[below] {C} ; + \coordinate (D) at (-1,-5) ; \draw (D) node[below] {D} ; + \coordinate (E) at (5,-2) ; \draw (E) node[left] {E} ; + \coordinate (F) at (8,-3) ; \draw (F) node[right] {F} ; + \coordinate (G) at (8.5,6) ; \draw (G) node[right] {G} ; + \coordinate (H) at (8.5,2.5) ; \draw (H) node[right] {H} ; + \tkzCompas{A}{B} + \tkzCompas[LongueurBranches=4,CouleurCrayon=blue]{C}{D} + \tkzCompas[LongueurBranches=3,CouleurCrayon=orange,Retourne, LongueurCrayon=3,CouleurCompas=black]{F}{E} + \tkzCompas[LongueurBranches=3,CouleurCrayon=Green, LongueurCrayon=3,CouleurCompas=purple]{F}{E} + \tkzCompas[Echelle=0.75,Retourne,CouleurCrayon=cyan,CouleurCompas=pink]{G}{H} +\end{tikzpicture} +\end{PresentationCode} + +\pagebreak + +\part{Exemple} + +\begin{PresentationCode}{listing only} +\tkzRegle[Fond,AfficheValeurs,Longueur=15,Rotation=-20,Echelle=0.5,CouleurFond=blue] +\tkzEquerre[Fond,AfficheValeurs,Longueur=12,Origine={(-20:4)}, Rotation=-20,CouleurFond=red,Echelle=0.5] +\tkzCrayon[Couleur=ForestGreen,Origine={(-20:4)},Rotation=30,Echelle=0.5] +\draw (10,-5)--++(20:5) (10,-5)--++(50:5) ; +\tkzRapporteur[Fond,CouleurFond=purple,Origine={(10,-5)},Echelle=0.5,Rotation=20] +\tkzRappEquerre[Fond,Origine={(9,1)},Rotation=90,CouleurFond=ForestGreen,Echelle=0.5] +\tkzCrayon[Couleur=yellow,Origine={(9,-1)},Rotation=20,Echelle=0.5] +\coordinate (AA) at ($(10,-5)+(50:{0.5*3.75})$) ; +\tkzCrayon[Couleur=orange,Origine={AA},Rotation=-20,Echelle=0.5,Longueur=6] +\tkzRequerre[Fond,AfficheValeurs,CouleurFond=yellow,Origine={(3,-3.5)}, Rotation=-30,Echelle=0.5] +\tkzCrayon[Couleur=gray,Origine={(3,-3)},Rotation=-98,Echelle=0.5] +\coordinate (FG) at (-1,1) ; \coordinate (FH) at (1,1.5) ; +\tkzCompas[LongueurBranches=3,LongueurCrayon=2]{FG}{FH} +\end{PresentationCode} + +\begin{PresentationCode}{text only} +\begin{tikzpicture} + \affichegrille{-2}{13}{-8}{5} + %\pointsutiles{(0,0),(2,1),(-4,-5),(-1,-5),(5,-2),(8,-3),(8.5,6),(8.5,2.5)} + \tkzRegle[Fond,Longueur=8,Rotation=-20,CouleurFond=blue] + \tkzEquerre + [Fond,Longueur=7,Origine={(-20:4)},Rotation=-20,CouleurFond=red] + \tkzCrayon[Couleur=ForestGreen,Origine={(-20:4)},Rotation=30,Longueur=3] + \draw (10,-5)--++(20:3) (10,-5)--++(50:3) ; + \tkzRapporteur[Fond,CouleurFond=purple,Origine={(10,-5)},Echelle=0.5,Rotation=20] + \tkzRappEquerre[Fond,Origine={(9,1)},Rotation=90,CouleurFond=ForestGreen,Largeur=4] + \tkzCrayon[Couleur=yellow,Origine={(9,-1)},Rotation=20,Longueur=3] + \coordinate (AA) at ($(10,-5)+(50:{0.5*3.75})$) ; + \tkzCrayon[Couleur=orange,Origine={AA},Rotation=-20,Longueur=6,Echelle=0.5] + \tkzRequerre[Fond,AfficheValeurs,CouleurFond=yellow,Origine={(3,-3.5)},Rotation=-30,Longueur=7,Largeur=2.5] + \tkzCrayon[Couleur=gray,Origine={(3,-3.5)},Rotation=-98,Longueur=3] + %compas + \coordinate (FG) at (-1,1) ; \coordinate (FH) at (1,1.5) ; + \tkzCompas[LongueurBranches=3,LongueurCrayon=2]{FG}{FH} +\end{tikzpicture} +\end{PresentationCode} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/outilsgeomtikz/README.md b/Master/texmf-dist/doc/latex/outilsgeomtikz/README.md new file mode 100644 index 00000000000..bf1842397de --- /dev/null +++ b/Master/texmf-dist/doc/latex/outilsgeomtikz/README.md @@ -0,0 +1,7 @@ +OutilsGeomTikz is a package with geometric tools in TikZ. +----------------------------------------------------------- +OutilsGeomTikz est un package avec outils géométriques en TikZ. +----------------------------------------------------------- +Author : Cédric Pierquet +email : cpierquet@outlook.fr +Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/outilsgeomtikz/OutilsGeomTikz.sty b/Master/texmf-dist/tex/latex/outilsgeomtikz/OutilsGeomTikz.sty new file mode 100644 index 00000000000..7b6784ca45e --- /dev/null +++ b/Master/texmf-dist/tex/latex/outilsgeomtikz/OutilsGeomTikz.sty @@ -0,0 +1,620 @@ +% Author.........: C. Pierquet +% licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{OutilsGeomTikz}[2023/03/03 v0.1.0 Outils géométriques en TikZ] +% 0.1.0 Version initiale + +%------Packages utiles +\RequirePackage{tikz,pgffor} +\RequirePackage{simplekv} +\RequirePackage{xstring} +\RequirePackage{nicefrac} +%librairies tikz +\usetikzlibrary{calc,positioning} + +%--------Crayon +% inspiration(s) de https://tex.stackexchange.com/questions/147389/symbols-of-pencil-ruler-and-compass +\defKV[CrayonGeom]{% + Echelle=\def\PENechelle{#1},% + Longueur=\def\PENlongueur{#1},% + Couleur=\def\PENcouleur{#1},% + Origine=\def\PENposOrigin{#1},% + Rotation=\def\PENangle{#1} +} + +\setKVdefault[CrayonGeom]{% + Echelle=1,% + Couleur=red,% + Longueur=5,% + Origine={(0,0)},% + Rotation=0 +} + +\NewDocumentCommand\tkzCrayon{ O{} }{% + \useKVdefault[CrayonGeom]% + \setKV[CrayonGeom]{#1}% + \xdef\PENlongueur{\fpeval{max(2.5,\PENlongueur)}}%valeurs mini + \begin{scope}[shift={(\PENposOrigin)},rotate=\PENangle,scale=\PENechelle] + \fill[\PENcouleur!75] (-0.2,{\PENlongueur-0.3}) -- (0.2,{\PENlongueur-0.3}) -- (0.2,0.8) --(0.1,0.65) -- (0,0.8) -- (-0.1,0.66) -- (-0.2,0.8) -- cycle; + \draw[color=white,line width={\PENechelle*1pt}] (0,{\PENlongueur-0.3}) -- (0,0.6); + \fill[black] (-0.2,{\PENlongueur-0.6}) -- (0,{\PENlongueur-0.65}) -- (0.2,{\PENlongueur-0.6}) -- (0.2,{\PENlongueur-0.12}) arc(30:150:0.23); + \fill[brown!40] (-0.2,0.8) -- (0,0) node[coordinate,pos=0.7] (a) {} -- (0.2,0.8) node[coordinate,pos=0.3] (b) {} -- (0.1,0.65) -- (0,0.8) -- (-0.1,0.66) -- cycle; + \fill[\PENcouleur] (a) -- (0,0) -- (b) -- cycle ; + \end{scope} +} + +%--------Règle (OK) +\defKV[RegleGeom]{% + Echelle=\def\REGLechelle{#1},% + Longueur=\def\REGLlongueur{#1},% + Largeur=\def\REGLlargeur{#1},% + Couleur=\def\REGLcouleur{#1},% + CouleurFond=\def\REGLcouleurfond{#1},% + Origine=\def\REGLposOrigin{#1},% + Rotation=\def\REGLangle{#1},% + Opacite=\def\REGLopac{#1},% + PosVal=\def\REGLposval{#1} +} + +\setKVdefault[RegleGeom]{% + Echelle=1,% + Couleur=black,% + CouleurFond=black,% + Longueur=12,% + Largeur=1.5,% + Origine={(0,0)},% + Rotation=0,% + AfficheValeurs=true,% + Fond=false,% + Opacite=0.5,% + PosVal=m +} + +\NewDocumentCommand{\tkzRegle}{ O{} }{% + \useKVdefault[RegleGeom]% + \setKV[RegleGeom]{#1}% + \xdef\REGLlongueur{\fpeval{max(3,\REGLlongueur)}}%valeurs mini + \xdef\REGLlargeur{\fpeval{max(1.5,\REGLlargeur)}} + \begin{scope}[shift={(\REGLposOrigin)},rotate=\REGLangle,scale=\REGLechelle] + \ifboolKV[RegleGeom]{Fond} + {% + \begin{scope} + \fill[draw=none,fill=\REGLcouleurfond!10!white,fill opacity=\REGLopac,even odd rule] (-0.375,0)--({\REGLlongueur+0.375},0) to[bend left=15] ({\REGLlongueur+0.375},{-\REGLlargeur}) -- (-0.375,{-\REGLlargeur}) to[bend left=15] (-0.375,0) (0.5,{-0.5*\REGLlargeur}) circle[radius={0.125*\REGLlargeur}] ; + \end{scope} + }% + {} + %bord et trou + \draw[semithick,\REGLcouleur] (-0.375,0)--({\REGLlongueur+0.375},0) to[bend left=15] ({\REGLlongueur+0.375},{-\REGLlargeur}) -- (-0.375,{-\REGLlargeur}) to[bend left=15] (-0.375,0) (0.5,{-0.5*\REGLlargeur}) circle[radius={0.125*\REGLlargeur}] ; + \foreach \x in {0,0.1,...,\REGLlongueur} {\draw[\REGLcouleur] (\x,0)--++(0,-0.25) (\x,{-\REGLlargeur})--++(0,0.25) ;} + \foreach \x in {0,0.5,...,\REGLlongueur} {\draw[\REGLcouleur] (\x,0)--++(0,-0.375) (\x,{-\REGLlargeur})--++(0,0.375) ;} + \foreach \x in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\x,0)--++(0,-0.5) (\x,{-\REGLlargeur})--++(0,0.5) ;} + \ifboolKV[RegleGeom]{AfficheValeurs}% + {% + \IfSubStr{\REGLposval}{h} + {\foreach \i in {0,1,...,\REGLlongueur} \draw[\REGLcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLangle,scale={0.8*\REGLechelle},font=\small,below] {$\i$} ;} + {} + \IfSubStr{\REGLposval}{m} + {\foreach \i in {0,1,...,\REGLlongueur} \draw[\REGLcouleur] (\i,{-0.5*\REGLlargeur}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLangle,scale={0.8*\REGLechelle},font=\small] {$\i$} ;} + {} + \IfSubStr{\REGLposval}{b} + {\foreach \i in {0,1,...,\REGLlongueur} \draw[\REGLcouleur] (\i,{-\REGLlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLangle,scale={0.8*\REGLechelle},font=\small,above] {\rotatebox{180}{$\fpeval{trunc(\REGLlongueur)-\i}$}} ;} + {} + }% + {}% + \end{scope} +} + +%--------Réquerre (OK) +\defKV[RequerreGeom]{% + Echelle=\def\REQechelle{#1},% + Longueur=\def\REQlongueur{#1},% + Largeur=\def\REQlargeur{#1},% + Couleur=\def\REQcouleur{#1},% + CouleurFond=\def\REQcouleurfond{#1},% + Origine=\def\REQposOrigin{#1},% + Rotation=\def\REQangle{#1},% + Opacite=\def\REQopac{#1} +} + +\setKVdefault[RequerreGeom]{% + Echelle=1,% + Couleur=black,% + CouleurFond=black,% + Longueur=12,% + Largeur=3,% + Origine={(0,0)},% + Rotation=0,% + AfficheValeurs=true,% + Fond=false,% + Opacite=0.5 +} + +\NewDocumentCommand{\tkzRequerre}{ O{} }{% + \useKVdefault[RequerreGeom]% + \setKV[RequerreGeom]{#1}% + \xdef\REQlongueur{\fpeval{max(6,\REQlongueur)}}%valeurs mini + \xdef\REQlargeur{\fpeval{max(1.5,\REQlargeur)}} + \begin{scope}[shift={(\REQposOrigin)},rotate=\REQangle,scale=\REQechelle] + \ifboolKV[RequerreGeom]{Fond} + { + \fill[draw=none,rounded corners,fill=\REQcouleurfond!10!white,fill opacity=\REQopac] ({-\REQlongueur*0.5},0) rectangle ({\REQlongueur*0.5},{-\REQlargeur}) ; + } + {} + \draw[semithick,\REQcouleur,rounded corners] ({-\REQlongueur*0.5},0) rectangle ({\REQlongueur*0.5},{-\REQlargeur}) ; + \draw[\REQcouleur] (0,-1)--(0,-\REQlargeur) ; + \foreach \x in {0,0.1,...,\fpeval{0.5*\REQlongueur-0.5}} {\draw[\REQcouleur] (\x,0)--(\x,-0.25) (-\x,0)--(-\x,-0.25) ;} + \foreach \x in {0,0.5,...,\fpeval{0.5*\REQlongueur-0.5}} {\draw[\REQcouleur] (\x,0)--(\x,-0.375) (-\x,0)--(-\x,-0.375) ;} + \foreach \x in {0,1,...,\fpeval{0.5*\REQlongueur-0.5}} {\draw[\REQcouleur] (\x,0)--(\x,-0.5) (-\x,0)--(-\x,-0.5) ;} + \foreach \x in {0.7,0.8,...,\REQlargeur} {\draw[\REQcouleur] (-2.65,-\x)--(-2.35,-\x) (2.65,-\x)--(2.35,-\x) ;} + \foreach \x in {1,1.5,...,\REQlargeur} {\draw[\REQcouleur] (-2.8,-\x)--(-2.2,-\x) (2.2,-\x)--(2.8,-\x) ;} + \begin{scope} + \clip ({-\REQlongueur*0.5},0) rectangle ({\REQlongueur*0.5},{-\REQlargeur}) ; + \draw[\REQcouleur] (0,-1) rectangle++ (0.2,-0.2) (0,-2) rectangle++ (-0.2,0.2) ; + \foreach \x in {1,2,...,\fpeval{\REQlargeur-0.25}} {\draw[\REQcouleur] ({-\REQlongueur*0.5},-\x)--({\REQlongueur*0.5},-\x) ;} + \end{scope} + \ifboolKV[RequerreGeom]{AfficheValeurs}% + {% + \draw[\REQcouleur] (0,-0.5) node[inner sep=1pt,outer sep=1pt,rotate=\REQangle,scale={0.8*\REQechelle},font=\small,below] {$0$} ; + \foreach \i in {1,2,...,\fpeval{0.5*\REQlongueur-0.5}}{% + \draw[\REQcouleur] (\i,-0.5) node[inner sep=1pt,outer sep=1pt,rotate=\REQangle,scale={0.8*\REQechelle},font=\small,below] {$\i$} ; + \draw[\REQcouleur] (-\i,-0.5) node[inner sep=1pt,outer sep=1pt,rotate=\REQangle,scale={0.8*\REQechelle},font=\small,below] {$-\i$} ;} + }% + {}% + \end{scope} +} + +%--------Équerre (OK) +\defKV[EquerreGeom]{% + Echelle=\def\EQechelle{#1},% + Longueur=\def\EQlongueur{#1},% + Couleur=\def\EQcouleur{#1},% + CouleurFond=\def\EQcouleurfond{#1},% + Origine=\def\EQposOrigin{#1},% + Rotation=\def\EQangle{#1},% + Opacite=\def\EQopac{#1} +} + +\setKVdefault[EquerreGeom]{% + Echelle=1,% + Couleur=black,% + CouleurFond=black,% + Longueur=10,% + Origine={(0,0)},% + Rotation=0,% + AfficheValeurs=true,% + Fond=false,% + Opacite=0.5 +} + +\NewDocumentCommand{\tkzEquerre}{ O{} }{% + \useKVdefault[EquerreGeom]% + \setKV[EquerreGeom]{#1}% + \xdef\EQlongueur{\fpeval{max(4.5,\EQlongueur)}}%valeurs mini + \def\EQlargeur{\fpeval{\EQlongueur*tand(30)}} + \begin{scope}[shift={(\EQposOrigin)},rotate=\EQangle,scale=\EQechelle] + \ifboolKV[EquerreGeom]{Fond} + {% + \begin{scope} %diff extérieur-intérieur + \fill[draw=none,fill=\EQcouleurfond!10!white,fill opacity=\EQopac,even odd rule] + (0,0) -- ({\EQlargeur},0) -- (0,{\EQlongueur}) -- cycle + ({1},{1}) -- ({\EQlargeur-sqrt(3)},{1}) -- ({1},{\EQlongueur-(2+sqrt(3))}) -- cycle ; + \end{scope} + }% + {} + \draw[semithick,\EQcouleur] (0,0) -- ({\EQlargeur},0) -- (0,{\EQlongueur}) -- cycle ; %contour extérieur + \draw[semithick,\EQcouleur] ({1},{1}) -- ({\EQlargeur-sqrt(3)},{1}) -- ({1},{\EQlongueur-(2+sqrt(3))}) -- cycle ; %contour intérieur + %graduations + \begin{scope} + \clip (0,0) -- ({\EQlargeur},0) -- (0,{\EQlongueur}) -- cycle ; + \draw[\EQcouleur] (0.1,0)--(0.1,0.075) (0.2,0)--(0.2,0.15) ; + \foreach \x in {0.3,0.4,...,\fpeval{0.925*\EQlargeur}} {\draw[\EQcouleur] (\x,0)--(\x,0.2) ;} + \foreach \x in {0.5,1,...,\fpeval{0.925*\EQlargeur}} {\draw[\EQcouleur] (\x,0)--(\x,0.3) ;} + \foreach \x in {0,1,...,\fpeval{0.925*\EQlargeur}} {\draw[\EQcouleur] (\x,0)--(\x,0.4) ;} + \draw[\EQcouleur] (0,0.1)--(0.075,0.1) (0,0.2)--(0.15,0.2) ; + \foreach \y in {0.3,0.4,...,\fpeval{0.925*\EQlongueur}} {\draw[\EQcouleur] (0,\y)--(0.2,\y) ;} + \foreach \y in {0.5,1,...,\fpeval{0.925*\EQlongueur}} {\draw[\EQcouleur] (0,\y)--(0.3,\y) ;} + \foreach \y in {0,1,...,\fpeval{0.925*\EQlongueur}} {\draw[\EQcouleur] (0,\y)--(0.4,\y) ;} + \ifboolKV[EquerreGeom]{AfficheValeurs}% + {% + \foreach \i in {1,2,...,\fpeval{0.9*\EQlongueur-1}} + \draw[\EQcouleur] (0.4,\i) node[inner sep=1pt,outer sep=1pt,rotate=\EQangle,scale={0.8*\EQechelle},font=\small,right] {\rotatebox{90}{$\i$}} ; + \foreach \i in {1,2,...,\fpeval{0.9*\EQlargeur-0.5}} + \draw[\EQcouleur] (\i,0.4) node[inner sep=1pt,outer sep=1pt,rotate=\EQangle,scale={0.8*\EQechelle},font=\small,above] {\rotatebox{180}{$\i$}} ; + }% + {}% + \end{scope} + \end{scope} +} + +%--------Rapporteur (OK) +\defKV[RapporteurGeom]{% + Echelle=\def\RAPPechelle{#1},% + EchelleAngle=\def\RAPPechangle{#1},% + Couleur=\def\RAPPcouleur{#1},% + CouleurFond=\def\RAPPcouleurfond{#1},% + Origine=\def\RAPPposOrigin{#1},% + Rotation=\def\RAPPangle{#1},% + Opacite=\def\RAPPopac{#1} +} + +\setKVdefault[RapporteurGeom]{% + Echelle=1,% + EchelleAngle=1,% + Couleur=black,% + CouleurFond=black,% + Origine={(0,0)},% + Rotation=0,% + AfficheAngles=true,% + Fond=false,% + Opacite=0.5,% + Complet=false +} + +\NewDocumentCommand{\tkzRapporteur}{ O{} }{% + \useKVdefault[RapporteurGeom]% + \setKV[RapporteurGeom]{#1}% + \begin{scope}[shift={(\RAPPposOrigin)},rotate=\RAPPangle,scale=\RAPPechelle,every node/.style={rotate=\RAPPangle}] + \ifboolKV[RapporteurGeom]{Complet} + { + %fond + \ifboolKV[RapporteurGeom]{Fond} + {% + \fill[draw=none,fill=\RAPPcouleurfond!10!white,fill opacity=\RAPPopac] (0,0) circle[radius=3.75] ; + }% + {} + %rectangles + \foreach \i in {30,45,60} + {\draw[densely dotted,\RAPPcouleur] (\i:2.5) rectangle ({180+\i}:2.5) ;} + %extérieur et intérieur + \draw[semithick,\RAPPcouleur] (0,0) circle[radius=3.75] ; + \draw[semithick,\RAPPcouleur] (0,0) circle[radius=2.5] ; + \draw[semithick,\RAPPcouleur] (-2.5,0) -- (2.5,0) ; + \draw[semithick,\RAPPcouleur] (0,-2.5) -- (0,2.5) ; + %grad degrés + \foreach \i in {0,1,...,360} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.55) ;} + \foreach \i in {0,5,...,360} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.45) ;} + \foreach \i in {0,10,...,360} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.35) ;} + %grad radians + \foreach \i in {0,30,45,60,90,120,135,150,180,210,225,240,270,300,315,330} {\draw[\RAPPcouleur] (\i:2.5)--(\i:2.65) (\i:2.9)--(\i:3.1) ;} + %valeurs si booléen + \ifboolKV[RapporteurGeom]{AfficheAngles} + {% + \draw[\RAPPcouleur] (0:2.75) node[rotate=90,scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$0$} ; + \draw[\RAPPcouleur] (180:3.25) node[rotate=90,scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\pm 180$} ; + \draw[\RAPPcouleur] (180:2.75) node[rotate=90,scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\pm \pi$} ; + \foreach \i in {0,10,...,170} + {\draw[\RAPPcouleur] (\i:3.25) node[rotate={\i-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\i$} ;} + \draw[\RAPPcouleur] (30:2.75) node[rotate={30-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{6}$} ; + \draw[\RAPPcouleur] (45:2.75) node[rotate={45-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{4}$} ; + \draw[\RAPPcouleur] (60:2.75) node[rotate={60-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{3}$} ; + \draw[\RAPPcouleur] (90:2.75) node[rotate={90-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{2}$} ; + \draw[\RAPPcouleur] (120:2.75) node[rotate={120-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{2\pi}{3}$} ; + \draw[\RAPPcouleur] (135:2.75) node[rotate={135-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{3\pi}{4}$} ; + \draw[\RAPPcouleur] (150:2.75) node[rotate={150-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{5\pi}{6}$} ; + \foreach \i in {10,20,...,170} + {\draw[\RAPPcouleur] ({-\i}:3.25) node[rotate={270-\i},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$-\i$} ;} + \draw[\RAPPcouleur] (-30:2.75) node[rotate={270-30},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{6}$} ; + \draw[\RAPPcouleur] (-45:2.75) node[rotate={270-45},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{4}$} ; + \draw[\RAPPcouleur] (-60:2.75) node[rotate={270-60},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{3}$} ; + \draw[\RAPPcouleur] (-90:2.75) node[rotate={270-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{2}$} ; + \draw[\RAPPcouleur] (-120:2.75) node[rotate={270-120},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-2\pi}{3}$} ; + \draw[\RAPPcouleur] (-135:2.75) node[rotate={270-135},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-3\pi}{4}$} ; + \draw[\RAPPcouleur] (-150:2.75) node[rotate={270-150},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-5\pi}{6}$} ; + }{} + } + { + %fond + \ifboolKV[RapporteurGeom]{Fond} + {% + \begin{scope} + \fill[draw=none,fill=\RAPPcouleurfond!10!white,fill opacity=\RAPPopac,even odd rule] + (-3.75,-0.75) -- (3.75,-0.75) -- (3.75,0) arc (0:180:3.75) -- cycle + (0.5,0) arc (0:180:0.5) -- (-2.25,0) arc (180:0:2.25) -- cycle ; + \end{scope} + }% + {} + %extérieur et intérieur + \draw[semithick,\RAPPcouleur] (-3.75,-0.75) -- (3.75,-0.75) -- (3.75,0) arc (0:180:3.75) -- cycle ; + \draw[semithick,\RAPPcouleur] (0.5,0) arc (0:180:0.5) -- (-2.25,0) arc (180:0:2.25) -- cycle ; + %croix + \draw[semithick,\RAPPcouleur] (-0.2,0)--(0.2,0) (0,-0.2)--(0,0.2) ; + %grad ext + \foreach \i in {0,1,...,180} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.55) ;} + \foreach \i in {0,5,...,180} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.45) ;} + \foreach \i in {0,10,...,180} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.35) ;} + %grad int + \foreach \i in {0,5,...,180} {\draw[\RAPPcouleur] (\i:2.25)--(\i:2.4) ;} + \foreach \i in {0,10,...,180} {\draw[\RAPPcouleur] (\i:2.25)--(\i:2.55) ;} + %valeurs si booléen + \ifboolKV[RapporteurGeom]{AfficheAngles} + {% + \foreach \i in {0,10,...,180} + {\draw[\RAPPcouleur] (\i:3.2) node[rotate={\i-90},scale=\fpeval{\RAPPechelle*\RAPPechangle},font=\tiny] {\i} ;} + \foreach \i in {0,10,...,180} + {\draw[\RAPPcouleur] (\i:2.7) node[rotate={\i-90},scale=\fpeval{\RAPPechelle*\RAPPechangle},font=\tiny] {\inteval{180-\i}} ;} + }{} + } + \end{scope} +} + +%--------RappÉquerre (OK) +\defKV[RapporteurEquerreGeom]{% + Echelle=\def\RAPPEQechelle{#1},% + Largeur=\def\RAPPEQlargeur{#1},% + EchelleValeurs=\def\RAPPEQechangle{#1},% + Couleur=\def\RAPPEQcouleur{#1},% + CouleurFond=\def\RAPPEQcouleurfond{#1},% + Origine=\def\RAPPEQposOrigin{#1},% + Rotation=\def\RAPPEQangle{#1},% + Opacite=\def\RAPPEQopac{#1} +} + +\setKVdefault[RapporteurEquerreGeom]{% + Echelle=1,% + Largeur=6,% + EchelleValeurs=1,% + Couleur=black,% + CouleurFond=black,% + Origine={(0,0)},% + Rotation=0,% + AfficheAngles=true,% + AfficheValeurs=true,% + Ombre=false,% + Fond=false,% + Opacite=0.5 +} + +\NewDocumentCommand{\tkzRappEquerre}{ O{} }{% + \useKVdefault[RapporteurEquerreGeom]% + \setKV[RapporteurEquerreGeom]{#1}% + \xdef\RAPPEQlargeur{\fpeval{max(3,\RAPPEQlargeur)}}%valeurs mini + \begin{scope}[shift={(\RAPPEQposOrigin)},rotate=\RAPPEQangle,scale=\RAPPEQechelle,every node/.style={rotate=\RAPPEQangle}] + %fond + \ifboolKV[RapporteurEquerreGeom]{Fond} + {% + \begin{scope} + \fill[draw=none,fill=\RAPPEQcouleurfond!10!white,fill opacity=\RAPPopac,even odd rule] (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; + \end{scope} + }% + {} + \ifboolKV[RapporteurEquerreGeom]{Ombre}% + {% + \filldraw[draw=none,fill=\RAPPEQcouleur!25,opacity=\RAPPopac] (-175:{0.65*\RAPPEQlargeur}) arc (-175:-5:{0.65*\RAPPEQlargeur}) -- (-5:{0.625*\RAPPEQlargeur}) arc (-5:-175:{0.625*\RAPPEQlargeur}) -- cycle ;% + }{}% + %extérieur + \draw[semithick,\RAPPEQcouleur] (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; + \foreach \x in {0,0.1,...,\fpeval{\RAPPEQlargeur-1}} + {\draw[\RAPPEQcouleur] ({\x},0)--({\x},-0.125) ({-\x},0)--({-\x},-0.125) ;} + \foreach \x in {0,0.5,...,\fpeval{\RAPPEQlargeur-1}} + {\draw[\RAPPEQcouleur] ({\x},0)--({\x},-0.1875) ({-\x},0)--({-\x},-0.1875) ;} + \foreach \x in {0,1,...,\fpeval{\RAPPEQlargeur-1}} + {\draw[\RAPPEQcouleur] ({\x},0)--({\x},-0.25) ({-\x},0)--({-\x},-0.25) ;} + %grad ext + \foreach \i in {5,6,...,175} + {\draw[\RAPPEQcouleur] ({-\i}:{0.5625*\RAPPEQlargeur})--++({-\i}:{0.02*\RAPPEQlargeur}) ;} + \foreach \i in {5,10,...,175} + {\draw[\RAPPEQcouleur] ({-\i}:{0.5625*\RAPPEQlargeur})--++({-\i}:{0.035*\RAPPEQlargeur}) ;} + %angles intérieurs + \ifboolKV[RapporteurEquerreGeom]{AfficheAngles} + {% + \foreach \i in {10,20,...,170} + {\draw[\RAPPEQcouleur] ({-\i}:{0.6125*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechelle*\RAPPEQechangle},font=\tiny] {\i} ;} + %angles "extérieurs" + \foreach \i in {10,20,...,170} + {\draw[\RAPPEQcouleur] ({-\i}:{0.6375*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechelle*\RAPPEQechangle},font=\tiny] {\inteval{180-\i}} ;} + }% + {}% + \ifboolKV[RapporteurEquerreGeom]{AfficheValeurs} + {% + \foreach \i in {-1,0,1} + {\draw[\RAPPEQcouleur] ({\i},-0.375) node[scale=\fpeval{\RAPPEQechelle*\RAPPEQechangle},font=\tiny] {$\i$} ;} + }% + {}% + %tracés intérieurs + \draw[\RAPPEQcouleur,dash pattern=on 15 off 4] (0,0)--(-135:{0.5625*\RAPPEQlargeur}) ; + \draw[\RAPPEQcouleur,dash pattern=on 15 off 4] (0,0)--(-45:{0.5625*\RAPPEQlargeur}) ; + \draw[\RAPPEQcouleur] (0,-0.5)--(0,{-0.51*\RAPPEQlargeur}) ; + \foreach \i in {0.4,0.5,...,\fpeval{0.51*\RAPPEQlargeur-0.5}} + {\draw[\RAPPEQcouleur] ({0.2625*\RAPPEQlargeur},{-\i})--++(0.2,0) ;} + \foreach \i in {0.4,0.5,...,\fpeval{0.51*\RAPPEQlargeur-0.5}} + {\draw[\RAPPEQcouleur] ({-0.2625*\RAPPEQlargeur},{-\i})--++(-0.2,0) ;} + \begin{scope} + \clip (-180:{0.55*\RAPPEQlargeur}) arc (-180:0:{0.55*\RAPPEQlargeur}) -- cycle ; + \foreach \i in {-0.5,-1,...,\fpeval{-0.55*\RAPPEQlargeur}} + {\draw[\RAPPEQcouleur] (0.2,\i)--({0.2375*\RAPPEQlargeur},\i) ({0.3125*\RAPPEQlargeur},\i)--({0.55*\RAPPEQlargeur},\i) ;} + \foreach \i in {-0.5,-1,...,\fpeval{-0.55*\RAPPEQlargeur}} + {\draw[\RAPPEQcouleur] (-0.2,\i)--({-0.2375*\RAPPEQlargeur},\i) ({-0.3125*\RAPPEQlargeur},\i)--({-0.55*\RAPPEQlargeur},\i) ;} + \end{scope} + %traits obliques extérieurs + \begin{scope} + \clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; + \foreach \i in {10,20,...,170} + {\draw[\RAPPEQcouleur] ({-\i}:{0.65*\RAPPEQlargeur})--++({-\i}:3) ;} + \foreach \i in {10,20,...,170} + {\draw[\RAPPEQcouleur] ({-\i}:{0.65*\RAPPEQlargeur})--++({-\i}:3) ;} + \end{scope} + \begin{scope} + \clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; + \def\cliptmp{\fpeval{min(0.15,0.0571*\RAPPEQlargeur)}} + \clip (0,-\RAPPEQlargeur)--++(135:\cliptmp)--++(\RAPPEQlargeur,\RAPPEQlargeur)--++(-45:\cliptmp)--cycle ; + \foreach \i in {1,2,...,89} + {\draw[\RAPPEQcouleur] ({\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({180-\i}:{abs(-0.3*\i/90+0.15)+0.15}) ;} + \end{scope} + \begin{scope} + \clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; + \def\cliptmp{\fpeval{min(0.25,0.0571*\RAPPEQlargeur)}} + \clip (0,-\RAPPEQlargeur)--++(135:\cliptmp)--++(\RAPPEQlargeur,\RAPPEQlargeur)--++(-45:\cliptmp)--cycle ; + \foreach \i in {5,10,...,85} + {\draw[\RAPPEQcouleur] ({\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({180-\i}:{abs(-0.5*\i/90+0.25)+0.25}) ;} + \end{scope} + \begin{scope} + \clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; + \def\cliptmp{\fpeval{min(0.15,0.0571*\RAPPEQlargeur)}} + \clip (0,-\RAPPEQlargeur)--++(45:\cliptmp)--++(-\RAPPEQlargeur,\RAPPEQlargeur)--++(-135:\cliptmp)--cycle ; + \foreach \i in {1,2,...,89} + {\draw[\RAPPEQcouleur] ({-\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({\i}:{abs(-0.3*\i/90+0.15)+0.15}) ;} + \end{scope} + \begin{scope} + \clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; + \def\cliptmp{\fpeval{min(0.25,0.0571*\RAPPEQlargeur)}} + \clip (0,-\RAPPEQlargeur)--++(45:\cliptmp)--++(-\RAPPEQlargeur,\RAPPEQlargeur)--++(-135:\cliptmp)--cycle ; + \foreach \i in {5,10,...,85} + {\draw[\RAPPEQcouleur] ({-\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({\i}:{abs(-0.5*\i/90+0.25)+0.25}) ;} + \end{scope} + \end{scope} +} + +%--------Compas +% inspiration(s) de https://tex.stackexchange.com/questions/147389/symbols-of-pencil-ruler-and-compass +% Angle entre l'horizontale et 2 noeuds (#1 & #2), résultat dans \MonAngleTmp +\newcommand{\NodeTmpAngle}[2]{% + \pgfmathanglebetweenpoints% + {\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \global\let\MonAngleTmp\pgfmathresult% +} +% Distance entre 2 noeuds (#1 & #2), résultat dans \MaLongueurTmp +\makeatletter +\newcommand{\NodeTmpDist}[2]{% + \pgfpointdiff{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}}% + \pgf@xa=\pgf@x + \pgf@ya=\pgf@y + % to convert from pt to cm + \pgfmathparse{veclen(\pgf@xa,\pgf@ya)/28.45274}% + \global\let\MaLongueurTmp\pgfmathresult% +} +\makeatother +% Récupération de l'unité x (cf https://tex.stackexchange.com/questions/424785/tikz-get-current-unit-length-of-x-coordinate) +\def\recupunitexencm{ + \path let \p{x}=(1,0), \n{xlencm}={scalar(veclen(\x{x},\y{x})/1cm)} + in \pgfextra{\xdef\TmpUniteX{\n{xlencm}}}; +} + +\defKV[CompasGeom]{% + Echelle=\def\COMPASechelle{#1},% + EchelleCrayon=\def\COMPASechellecrayon{#1},% + LongueurBranches=\def\COMPASLLB{#1},% + LongueurCrayon=\def\COMPASLLC{#1},% + CouleurCompas=\def\COMPAScouleur{#1},% + CouleurCrayon=\def\COMPAScouleurcrayon{#1},% + UniteTikz=\def\COMPASunittikz{#1} +} + +\setKVdefault[CompasGeom]{% + Echelle=1,% + EchelleCrayon=1,% + LongueurBranches=6,% + LongueurCrayon=5,% + CouleurCrayon=red,% + CouleurCompas=gray,% + UniteTikz=\TmpUniteX,% + AfficheCrayon=true,% + Retourne=false +} + +\NewDocumentCommand{\tkzCompas}{ s O{} m m }{%étoilée en gardant la distance entre extrémités + \IfBooleanTF{#1}{}{\NodeTmpDist{#3}{#4}}% + \useKVdefault[CompasGeom]% + \setKV[CompasGeom]{#2}% + %calculs intermédiaires + \recupunitexencm + \NodeTmpAngle{#3}{#4}% + \pgfmathsetmacro{\AngleCP}{asin(\MaLongueurTmp/(\COMPASunittikz*\COMPASechelle*2*\COMPASLLB))} + %retour aux affaires + \ifboolKV[CompasGeom]{Retourne} + {\def\CoeffYscale{-1}}{\def\CoeffYscale{1}} + \begin{scope}[shift=(#3),scale=\COMPASechelle] + \begin{scope}[join=round,rotate=\MonAngleTmp,yscale=\CoeffYscale,shift=(270-\AngleCP:-\COMPASLLB)] + % branche pointe sèche + \draw[rotate=-\AngleCP,fill=\COMPAScouleur!80] (0,0)--(0,-\COMPASLLB)--(-.2,-\COMPASLLB+.8)--(-.2,0)--cycle ; + \draw[rotate=-\AngleCP,fill=\COMPAScouleur!05] (0,-\COMPASLLB+.8)--(0,-\COMPASLLB)--(-.2,-\COMPASLLB+.8)--cycle ; + % branche crayon + \draw[rotate=\AngleCP,fill=\COMPAScouleur!80] (0,0)--(0,-\COMPASLLB)--(.2,-\COMPASLLB+.8)--(.2,0)--cycle ; + \begin{scope}[rotate=\AngleCP,shift={(0,-\COMPASLLB)}] + \ifboolKV[CompasGeom]{AfficheCrayon} + {\tkzCrayon[Echelle={\COMPASechellecrayon*0.75},Longueur={\COMPASLLC/0.75},Rotation=-15,Couleur=\COMPAScouleurcrayon]}{} + \draw[fill=gray!25] (\COMPASLLB/30,\COMPASLLB/5) circle (\COMPASLLB/36) ; + \fill[\COMPAScouleur!5] (\COMPASLLB/30,\COMPASLLB/5) -- ++(30:\COMPASLLB/36) arc (30:45:\COMPASLLB/36) -- cycle ; + \fill[\COMPAScouleur!5] (\COMPASLLB/30,\COMPASLLB/5) -- ++(210:\COMPASLLB/36) arc (210:225:\COMPASLLB/36) ; + \draw (\COMPASLLB/30,\COMPASLLB/5) circle (\COMPASLLB/36) ; + \filldraw (\COMPASLLB/30,\COMPASLLB/5) circle (.02) ; + \end{scope} + % haut du compas + \draw[fill=\COMPAScouleur!80] (-.1,0) rectangle (.1,.85) ; + \draw[fill=gray!25] (0,0) circle (.25) ; + \fill[gray!5] (0,0) -- (30:.25) arc (30:45:.25) -- cycle ; + \fill[gray!5,rotate=180] (0,0) -- (30:.25) arc (30:45:.25) -- cycle ; + \draw (0,0) circle (.25) ; + \filldraw (0,0) circle (.05) ; + \end{scope} + \end{scope} +} + +%--------MiniÉquerre +\defKV[MiniEquerreGeom]{% + Echelle=\def\MiniEQechelle{#1},% + Couleur=\def\MiniEQcouleur{#1},% + Origine=\def\MiniEQposOrigin{#1},% + Rotation=\def\MiniEQangle{#1} +} + +\setKVdefault[MiniEquerreGeom]{% + Echelle=1,% + Couleur=black,% + Origine={(0,0)},% + Rotation=0,% + Ombre=true +} + +\NewDocumentCommand{\tkzMiniEquerre}{ O{} }{% + \useKVdefault[MiniEquerreGeom]% + \setKV[MiniEquerreGeom]{#1}% + \begin{scope}[shift={(\MiniEQposOrigin)},rotate=\MiniEQangle,scale=\MiniEQechelle] + \ifboolKV[MiniEquerreGeom]{Ombre}% + {% + \begin{scope} + \clip (0,0)--(1,0)--(0,1.8)--cycle; + \filldraw[draw=none,fill=\MiniEQcouleur!10] (0,0) rectangle (1,2.5pt); + \filldraw[draw=none,fill=\MiniEQcouleur!10] (0,0) rectangle (2.5pt,2); + \end{scope} + }{}% + \draw[semithick,\MiniEQcouleur] (0,0)--(1,0)--(0,1.8)--cycle; + \draw[semithick,\MiniEQcouleur] (0.2,0.2)--(0.65,0.2)--(0.2,1)--cycle; + \foreach \x in {0,0.1,...,1} {\draw[\MiniEQcouleur] (\x,0)--++(0,1.5pt) ;} + \foreach \x in {0,0.5} {\draw[\MiniEQcouleur] (\x,0)--++(0,2pt) ;} + \foreach \y in {0,0.1,...,1.7} {\draw[\MiniEQcouleur] (0,\y)--++(1.5pt,0) ;} + \foreach \y in {0,0.5,1,1.5} {\draw[\MiniEQcouleur] (0,\y)--++(2pt,0) ;} + \end{scope} +} + +%--------MiniRègle +\defKV[MiniRegleGeom]{% + Echelle=\def\MiniREGLechelle{#1},% + Couleur=\def\MiniREGLcouleur{#1},% + Origine=\def\MiniREGLposOrigin{#1},% + Rotation=\def\MiniREGLangle{#1} +} + +\setKVdefault[MiniRegleGeom]{% + Echelle=1,% + Couleur=black,% + Origine={(0,0)},% + Rotation=0,% + Ombre=true +} + +\NewDocumentCommand{\tkzMiniRegle}{ O{} }{% + \useKVdefault[MiniRegleGeom]% + \setKV[MiniRegleGeom]{#1}% + \begin{scope}[shift={(\MiniREGLposOrigin)},rotate=\MiniREGLangle,scale=\MiniREGLechelle] + \ifboolKV[MiniRegleGeom]{Ombre}% + {\filldraw[draw=none,fill=\MiniREGLcouleur!10] (0,0) rectangle (2,-2.5pt) ;}{}% + \draw[semithick,\MiniREGLcouleur] (0,0)--(2,0)--(2,-0.3)--(0,-0.3)--cycle ; + \draw[semithick,\MiniREGLcouleur] (0.35,-0.185) circle[radius=0.05] ; + \foreach \y in {0,0.1,...,2} {\draw[\MiniREGLcouleur] (\y,0)--++(0,-1.5pt) ;} + \foreach \y in {0,0.5,...,2} {\draw[\MiniREGLcouleur] (\y,0)--++(0,-2pt) ;} + \end{scope} +} + +\endinput
\ No newline at end of file diff --git a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc index 66eb234d13e..acef22f1c0a 100644 --- a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc @@ -100,6 +100,7 @@ depend neuralnetwork depend nl-interval depend nndraw depend numericplots +depend outilsgeomtikz depend pb-diagram depend penrose depend petri-nets diff --git a/Master/tlpkg/tlpsrc/outilsgeomtikz.tlpsrc b/Master/tlpkg/tlpsrc/outilsgeomtikz.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/outilsgeomtikz.tlpsrc |