From: Maxime Chupin (escudo) Date: Thu, 24 Nov 2016 20:27:58 +0000 (+0100) Subject: Doc: Avancées, apparence des commandes X-Git-Url: https://melusine.eu.org/syracuse/G/git/?p=delaunay.git;a=commitdiff_plain;h=02c985137bc9977698c0fff1a6d5b747d69192b0 Doc: Avancées, apparence des commandes --- diff --git a/doc/luamesh-doc.listing b/doc/luamesh-doc.listing index 319b968..eaf92de 100644 --- a/doc/luamesh-doc.listing +++ b/doc/luamesh-doc.listing @@ -1 +1 @@ -\usepackage{luamesh} + \buildMeshBW{(0.3,0.3);(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)} diff --git a/doc/luamesh-doc.pdf b/doc/luamesh-doc.pdf index 295ebb5..41c87e3 100644 Binary files a/doc/luamesh-doc.pdf and b/doc/luamesh-doc.pdf differ diff --git a/doc/luamesh-doc.tex b/doc/luamesh-doc.tex index 5746bb2..d68baa3 100644 --- a/doc/luamesh-doc.tex +++ b/doc/luamesh-doc.tex @@ -13,6 +13,35 @@ \author{Maxime Chupin \email{mc@melusine.eu.org}} \date{\today} +\newcommand*\commande{\noindent\hspace{-30pt}% + \SaveVerb[aftersave={% + \UseVerb{Vitem} + }% + ]{Vitem}} + +\usepackage{xargs} +\newcommand*\textme[1]{\color{black}{\rmfamily\textit{#1}}} +\newcommand*\meta[1]{% % meta + \textme{\ensuremath{\langle}#1\ensuremath{\rangle}}} +\newcommand*\optstar{% % optional star + \meta{\ensuremath{*}}\xspace} +\DefineShortVerb{\|} + +\setlength{\fboxsep}{2pt} +\fvset{% + codes={\catcode`\«\active \catcode`\×\active }, + defineactive={\makefancyog\makefancytimes}, + formatcom=\color{red}, + frame=single +} +% rendre «...» équivalent à \meta{...} +{\catcode`\«\active + \newcommandx\makefancyog[0][addprefix=\global]{% + \def«##1»{\meta{##1}}}} +% rendre × équivalent à \optstar +{\catcode`\×\active + \newcommandx\makefancytimes[0][addprefix=\global]{% + \def×{\optstar{}}}} \tcbuselibrary{listings,breakable} @@ -72,7 +101,7 @@ \maketitle \begin{abstract} - The package \Verb|luamesh| allows to compute and draw triangulation + The package \Verb|luamesh| allows to compute and draw 2D triangulation of Delaunay. The algorithm is written with lua, and depending of the choice of the ``engine'', the draw is done by MetaPost (with \Verb|luamplib|) or by \Verb|tikz|. @@ -109,17 +138,81 @@ with \usepackage{luamesh} \end{latexcode} +\subsection{Dependencies} + +This package is built upon two main packages to draw the +triangulations : +\begin{enumerate} +\item \Verb+luamplib+ to use MetaPost via the \luatex library + \Verb+mplib+; +\item or \Verb+tikz+. +\end{enumerate} +We will see how to choose between these two \emph{drawing engines}. + +Moreover, the following packages are necessary: +\begin{enumerate} +\item \Verb+xkeyval+ to manage the optional arguments; +\item \Verb+xcolor+ to use colors (needed by \Verb+luamplib+); +\item \Verb+ifthen+ to help the programming with \TeX. +\end{enumerate} -\section{The Macros} +\section{The Basic Macros} +If you want to use this package, you must compile your document with +\Verb+lualatex+: + +\begin{commandshell} + lualatex mylatexfile.tex +\end{commandshell} + +Let us recall that this package provides macros to draw two +dimensional triangulations (or meshes). \subsection{Draw a Complete Mesh} +\commande|\buildMeshBW[«options»]{«list of points» or «file name»}|\medskip + +This macro produce the Delaunay triangulation (using the Bowyer and +Watson algorithm) of the given \meta{list of points}. The list of +points must be given in the following way : +\begin{center} + \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+ +\end{center} + +\begin{Exemple} + \buildMeshBW{(0.3,0.3);(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)} +\end{Exemple} + +\subsubsection{The Options} + +There are several options to customize the drawing. +\begin{description} +\item[\color{red}\texttt{mode = int (default) or ext}:] the mode option allow to + use either the previously described set of point in the argument, or + a file, containing, line by line (2 columns), the points. Such a + file looks like : +\begin{verbatim} +x1 y1 +x2 y2 +x3 y3 +... +xn yn +\end{verbatim} +\end{description} + \subsection{Draw the Set of Points} +\commande|\tracePointsMesh[«options»]{«list of points» or «file name»}| + + \subsection{Draw a Step of the Bowyer and Watson Algorithm} +\commande|\meshAddPointBW[«options»]{«list of points» or «file name»}{«point» or «number of line»}| + + +\section{The \emph{inc} Macros} + \section{Gallery of Examples} \end{document} diff --git a/luamesh.sty b/luamesh.sty index 1e1a99e..69d2ad8 100644 --- a/luamesh.sty +++ b/luamesh.sty @@ -11,7 +11,7 @@ %\define@key{luamesh.sty}{mp}[]{\luameshmptrue}% %\define@key{luamesh.sty}{tikz}[]{\luameshmpfalse}% % -\RequirePackage{etoolbox} % pour robustifier les commandes +%\RequirePackage{etoolbox} % pour robustifier les commandes % % %\ifluameshmp%