Bug avec la fonction TeXaddOnePoint Tikz côté lua
[delaunay.git] / doc / luamesh-doc.tex
index 2cd1781..9a6e6ad 100644 (file)
   every listing line={\textcolor{red}{\small\ttfamily\bfseries user \$> }}}
 
 \newtcblisting{latexcode}{
-  arc=0pt,
+  arc=0pt,outer arc=0pt,
+  colback=red!2!white,
+  colframe=red!75!black,
+  breakable,
+  boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle =
+  3pt, toptitle=3pt,
+  boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break =
+  0pt, bottomrule at break = 0pt,
   listing only,boxsep=0pt,listing
-  options={style=tcblatex}}
+  options={breaklines}
+}
 
 
 \newcommand\luamesh{\Verb+luamesh+\xspace}
   set of points, a particular step of the algorithm.
 \end{abstract}
 
+I would like to thank Jean-Michel Sarlat, who hosts the development
+with a git project on the \Verb+melusine+ machine:
+\begin{center}
+  \url{https://melusine.eu.org/syracuse/G/delaunay/}
+\end{center}
+Then, I would like to thank the first user, and an intensive
+\emph{test} user: Nicole Spillane.
+
 \section{Installation}
 
-\subsection{With Linux}
+
+Of course, you can just put the two files \Verb+luamesh.lua+ and
+\Verb+luamesh.sty+ in the working directory, but it is not
+recommended.
+
+
+\subsection{With \TeX live and Linux or Mac OSX}
 
 To install \luamesh with \TeX live, you have to create the local
 \Verb+texmf+ directory in your \Verb+home+.
@@ -198,6 +220,25 @@ with
 \usepackage{luamesh}
 \end{latexcode}
 
+\subsection{With Mik\TeX{} and Windows}
+
+We do not know these two systems, so we refer to the
+documentation for integrating local additions to Mik\TeX:
+\begin{center}
+  \url{http://docs.miktex.org/manual/localadditions.html}
+\end{center}
+
+
+\subsection{A \lualatex package}
+
+If you want to use this package, you must compile your document with
+\Verb+lualatex+:
+
+\begin{commandshell}
+  lualatex mylatexfile.tex
+\end{commandshell}
+
+
 \subsection{Dependencies}
 
 This package is built upon two main packages to draw the
@@ -205,7 +246,7 @@ triangulations :
 \begin{enumerate}
 \item \Verb+luamplib+ to use MetaPost via the \luatex library
   \Verb+mplib+;
-\item or \Verb+tikz+.
+\item and \Verb+tikz+.
 \end{enumerate}
 We will see how to choose between these two \emph{drawing engines}.
 
@@ -219,17 +260,10 @@ Moreover, the following packages are necessary:
 
 \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}
+\subsection{Draw a Complete Mesh}\label{sec:buildMesh}
 
 \commande|\buildMeshBW[«options»]{«list of points» or «file name»}|\medskip
 
@@ -248,7 +282,7 @@ points must be given in the following way :
 
 There are several options to customize the drawing.
 \begin{optionsenum}
-\item[mode = int (default) or ext:] this option allows to
+\item[mode = int (default) \textme{or} ext:] this option allows 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 :
@@ -259,7 +293,7 @@ x3  y3
 ...
 xn yn
 \end{verbatim}
-\item[bbox = none (default) or show:] this option allows to draw the
+\item[bbox = none (default) \textme{or} show:] this option allows to draw the
   added points to form a \emph{bounding box}\footnote{The bounding
     box is defined by four points place at 15\% around the box
     defined by $(x_{\min},y_{\min})$, $(x_{\min},y_{\max})$,
@@ -271,7 +305,7 @@ xn yn
 \item[colorBbox = \meta{value} (default: black):] The color of the
   drawing for the elements (points and triangles) belonging to the
   bounding box.
-\item[print = none (default) or points:] To label the vertices of the
+\item[print = none (default) \textme{or} points:] To label the vertices of the
   triangulations with an adding dot.
 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
   label the vertices of the triangulation. It is include in the math
@@ -321,16 +355,201 @@ will be allowed to add code before and after the generated one by
 
 \subsection{Draw the Set of Points}
 
-\commande|\drawPointsMesh[«options»]{«list of points» or «file name»}|
+\commande|\drawPointsMesh[«options»]{«list of points» or «file name»}|\medskip
+
+With the \Verb+\drawPointsMesh+, we plot the set of the points from
+which the Browyer and Watson algorithm compute the triangulation.
+
+The use of this macro is quite similar to the
+\Verb+\buildMeshBW+. Here is an example of the basic uses.
+\begin{Exemple}
+  \drawPointsMesh{(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 (exactly the same that for the
+\Verb+\buildMeshBW+)to customize the drawing.
+\begin{optionsenum}
+\item[mode = int (default) \textme{or} ext:] this option allows 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}
+\item[bbox = none (default) \textme{or} show:] this option allows to draw the
+  added points to form a \emph{bounding box} and the corresponding
+  triangulation. By default, these triangles are removed at the end of
+  the algorithm. \emph{Here, because we plot only the vertices of the
+    mesh, there is no triangles, but only dots.}
+\item[color = \meta{value} (default: black):] The color of the
+  drawing.
+\item[colorBbox = \meta{value} (default: black):] The color of the
+  drawing for the elements (points and triangles) belonging to the
+  bounding box.
+\item[print = none (default) \textme{or} points:] To label the vertices of the
+  triangulations with an adding dot. Without label, there is a dot.
+\item[meshpoint = \meta{value} (default: P):] The letter(s) used to
+  label the vertices of the triangulation. It is include in the math
+  mode delimiters \Verb+$...$+. The bounding box points are labeled
+  with a star exponent, and numbered from 1 to 4.
+\item[tikz (boolean, default:false):] By default, this boolean is set
+  to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
+  the picture. With this option, it is \Verb+tikz+ the \textit{drawing
+    engine}.
+\item[scale = \meta{value} (default: 1cm):] The scale option defines
+  the scale at which the picture is draw (the same for the two
+  axis). It must contain the unit of length (cm,
+  pt, etc.).
+\end{optionsenum}
+With the same external mesh point file presented in
+section~\ref{sec:buildMesh}, we illustrate the different options.
+
+\begin{Exemple}
+  \drawPointsMesh[%
+  tikz,
+  mode = ext,
+  bbox = show,
+  color = blue,
+  colorBbox = red,
+  print = points,
+  meshpoint = y,
+  scale = 1.3cm,
+  ]{mesh.txt}
+\end{Exemple}
 
 
 \subsection{Draw a Step of the Bowyer and Watson Algorithm}
 
-\commande|\meshAddPointBW[«options»]{«list of points» or «file name»}{«point» or «number of line»}|
+\commande|\meshAddPointBW[«options»]{«list of points» or «file name»}{«point» or «number of line»}|\medskip
+
+This command allows to plot the different step of the addition of a
+point in a Delaunay triangulation, using the Bowyer and Watson
+algorithm.
+
+This macro produce the Delaunay triangulation (using the Bowyer and
+Watson algorithm) of the given \meta{list of points} and shows a step
+of the algorithm when the \meta{point} is added. The list of
+points must be given in the following way:
+\begin{center}
+  \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
+\end{center}
+and the point is of the form \verb+(x,y)+. The \meta{file name}
+and \meta{number of line}  will be explained in the option
+description.
+
+One can use the macro as fallow:
+\begin{Exemple}
+  \meshAddPointBW[step=badtriangles]{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
+  \meshAddPointBW[step=cavity]{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
+  \meshAddPointBW[step=newtriangles]{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
+\end{Exemple}
+The default value for \Verb+step+ is \Verb+badtriangles+. The first
+line is then equivalent to
+\begin{latexcode}
+\meshAddPointBW{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
+\end{latexcode}
+
+\subsubsection{The Options}
+
+There are several options (some of them are the same as for
+\Verb+\buildMeshBW+) to customize the drawing.
+\begin{optionsenum}
+\item[mode = int (default) \textme{or} ext:] this option allows to
+  use either the previously described set of point in the argument
+  number one, 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}
+For the second argument of the macro, if we are in the
+\Verb+mode = ext+, the argument must be the \emph{line number} of the file
+corresponding to the point we want to add. The algorithm will stop the
+line before to build the initial triangulation for which it will add
+the point corresponding to the line. The other lines of the file are
+ignored.
+\item[bbox = none (default) \textme{or} show:] this option allows to draw the
+  added points to form a \emph{bounding box} and the corresponding
+  triangulation. By default, these triangles are removed at the end of
+  the algorithm.
+\item[color = \meta{value} (default: black):] The color of the
+  drawing.
+\item[colorBbox = \meta{value} (default: black):] The color of the
+  drawing for the elements (points and triangles) belonging to the
+  bounding box.
+\item[colorNew = \meta{value} (default: red):] The color of the
+  drawing of the ``new'' elements which are the point to add, the
+  polygon of the cavity, and the new triangles.
+\item[colorBack = \meta{value} (default: black!20):] The color for the
+  filling of the region concerned by the addition of the new point.
+\item[colorCircle = \meta{value} (default: green):] The color for
+  circoncircle of the triangles containing the point to add.
+\item[meshpoint = \meta{value} (default: P):] The letter(s) used to
+  label the vertices of the triangulation. It is include in the math
+  mode delimiters \Verb+$...$+. The bounding box points are labeled
+  with a star exponent, and numbered from 1 to 4.
+\item[step = badtriangles (default) \textme{or} cavity \textme{or}
+  newtriangles:] To choose the step we want to draw, corresponding to
+  the steps of the Bowyer and Watson algorithm.
+\item[newpoint = \meta{value} (default: P):] The letter(s) used to
+  label the new point of the triangulation. It is include in the math
+  mode delimiters \Verb+$...$+.
+\item[tikz (boolean, default:false):] By default, this boolean is set
+  to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
+  the picture. With this option, it is \Verb+tikz+ the \textit{drawing
+    engine}.
+\item[scale = \meta{value} (default: 1cm):] The scale option defines
+  the scale at which the picture is draw (the same for the two
+  axis). It must contain the unit of length (cm,
+  pt, etc.).
+\end{optionsenum}
 
+Here is an example of customization of the drawing. First, recall that
+the external file \Verb+mesh.txt+ is:
+\begin{verbatim}
+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{verbatim}
+We draw the addition of the 6th point. The 7th line will be ignored.
+\begin{Exemple}
+  \meshAddPointBW[
+  tikz,
+  mode = ext,
+  color = blue!70,
+  meshpoint = x,
+  newpoint = y,
+  colorBack=red!10,
+  colorNew = green!20!red,
+  colorCircle = blue,
+  colorBbox = black!20,
+  bbox = show,
+  scale=1.4cm,
+  step=cavity]
+  {mesh.txt}{6}
+\end{Exemple}
 
 \section{The \emph{inc} Macros}\label{sec:inc}
 
+\subsection{With MetaPost}
+
+%\subsection{With \Verb+tikz+}
+
 \section{Gallery of Examples}
 
 \end{document}

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.