summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex')
-rw-r--r--Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex152
1 files changed, 119 insertions, 33 deletions
diff --git a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex b/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex
index 07b6125f0fc..25481872b4d 100644
--- a/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex
+++ b/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex
@@ -18,6 +18,7 @@
\author{Maxime Chupin \email{notezik@gmail.com}}
\date{\today}
+\addbibresource{biblio.bib}
\definecolor{darkred}{rgb}{0.8,0.1,0.1}
@@ -137,7 +138,7 @@
\lstset{moredelim=*[s][\color{red}\rmfamily\itshape]{<}{>}}
\lstset{moredelim=*[s][\color{blue}\rmfamily\itshape]{<<}{>>}}
-\usepackage[colorlinks=true]{hyperref}
+
\begin{document}
%% === Page de garde ===================================================
\thispagestyle{empty}
@@ -167,7 +168,7 @@
}
\vfill
\begin{center}
- Version 0.6, 2020, June, 6th \\
+ Version 0.7, 2022, July, 8th \\
\url{https://plmlab.math.cnrs.fr/mchupin/luamesh}
\end{center}
%% == Page de garde ====================================================
@@ -186,14 +187,18 @@
set of points, or 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:
+I would like to thank Jean-Michel Sarlat, who hosts first the development
+with a git project on the \Verb+melusine+ machine. Now the project is hosted
+here :
\begin{center}
- \url{https://melusine.eu.org/syracuse/G/delaunay/}
+ \url{https://plmlab.math.cnrs.fr/mchupin/luamesh}
\end{center}
I would also like to thank the first user, an intensive
\emph{test} user, and a very kind English corrector: Nicole Spillane.
+For the references of the algorithm, see~\cite{Bowyer,Watson} and a reference about
+mesh is~\cite{Frey}.
+
\tableofcontents
@@ -206,10 +211,6 @@ your distribution.
\url{https://www.ctan.org/pkg/luamesh}
\end{center}
-Of course, you can just put the two files \Verb+luamesh.lua+ and
-\Verb+luamesh.sty+ in the working directory but this is not
-recommended.
-
\subsection{With \TeX live and Linux or Mac OSX}
@@ -225,12 +226,15 @@ Then place the files in the correct directories. The
\begin{center}
\Verb+~/texmf/tex/latex/luamesh/+
\end{center}
-and the \Verb+luamesh.lua+, the \Verb+luamesh-tex.lua+ and the
+the \Verb+luamesh.lua+, the \Verb+luamesh-tex.lua+ and the
\Verb-luamesh-polygon.lua+ files must be in directory:
\begin{center}
\Verb+~/texmf/scripts/luamesh/+
\end{center}
-
+and the \Verb+luamesh.mp+ file must be in directory:
+\begin{center}
+ \Verb+~/texmf/metapost/luamesh/+
+\end{center}
Once you have done this, \luamesh can be included in your document
with
\begin{latexcode}
@@ -262,9 +266,9 @@ This package is built upon two main existing packages that one used to
draw the
triangulations :
\begin{enumerate}
-\item \Verb+luamplib+ to use MetaPost via the \luatex library
+\item \Verb+luamplib+ to use MetaPost~\cite{luamplib} via the \luatex library
\Verb+mplib+;
-\item \Verb+tikz+.
+\item \Verb+tikz+~\cite{tikz}.
\end{enumerate}
We will see how to choose between these two \emph{drawing engines}.
Moreover, the following packages are necessary:
@@ -285,7 +289,7 @@ dimensional triangulations (or meshes).
\commande|\buildMeshBW[«options»]{«list of points» or «file name»}|\medskip
This macro produces the Delaunay triangulation (using the Bowyer and
-Watson algorithm) of the given \meta{list of points}. The list of
+Watson algorithm, \cite[Bowyer]) 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)+
@@ -339,6 +343,9 @@ xn yn
the scale at which the picture is drawn (the same for both
axes). It must contain the unit of length (cm,
pt, etc.).
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
To illustrate the options, let us show you an example. We consider a
@@ -362,6 +369,7 @@ file \Verb+mesh.txt+:
print = points,
meshpoint = x,
scale = 1.3cm,
+ thickness = 1pt
]{mesh.txt}
\end{Exemple}
@@ -541,6 +549,16 @@ ignored.
the scale at which the picture is drawn (the same for both
axis). It must contain the unit of length (cm,
pt, etc.).
+ \item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines for the mesh. It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessNew = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines for the polygon and the \emph{new} elements. It
+ must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessCircle = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the circles. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
Here is an example of customizing the drawing. First, recall that
@@ -568,7 +586,11 @@ We draw the addition of the 6th point. The 7th line will be ignored.
colorBbox = black!20,
bbox = show,
scale=1.4cm,
- step=badtriangles]
+ step=badtriangles,
+ thickness=0.2pt,
+ thicknessCircle=1pt,
+ thicknessNew=3pt % useless because this step
+ ]
{mesh.txt}{6}
\end{Exemple}
@@ -653,6 +675,12 @@ xn yn
allows to specify the mode of generation of the grid points. The
value \Verb+rect+ produces a simple rectangular grid, and the value
\Verb+pertub+ randomly perturbs the rectangular grid.
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh. It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessPolygon = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the polygon. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
Here is an example of customizing the drawing.
@@ -665,7 +693,9 @@ Here is an example of customizing the drawing.
scale=4cm,
step=mesh,
print=points,
- gridpoints=perturb]
+ gridpoints=perturb,
+ thickness=0.5pt,
+ thicknessPolygon=1pt]
{(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
\end{Exemple}
@@ -675,7 +705,8 @@ Here is an example of customizing the drawing.
The three macros presented in the above sections have complementary
macros, with the suffix \Verb+inc+ that allow the user to add code
(MetaPost or \Verb+tikz+, depending of the drawing engine) before and
-after the code generated by \luamesh.
+after the code generated by \luamesh. These commands have the same options as
+the non \emph{inc} one.
The three macros are:\medskip
@@ -775,7 +806,8 @@ color = red,
colorBbox = blue!30,
print = points,
meshpoint = x,
-scale=0.8cm
+scale=0.8cm,
+thickness = 1.4pt
]{(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)}%
{% code before
beginfig(0);
@@ -876,7 +908,8 @@ code given by \meta{code
colorBbox = blue!30,
print = points,
meshpoint = x,
- scale=0.8cm
+ scale=0.8cm,
+ thickness=1pt
]{(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)}%
{% code before
}
@@ -887,7 +920,7 @@ code given by \meta{code
\section{Voronoï Diagrams}
-Another interesting feature of b Delaunay triangulation is that its
+Another interesting feature of the Delaunay triangulation is that its
\emph{dual} is the so-called Voronoï diagram. More precisely, for a
finite set of
points $\{p_{1},\ldots, p_{n}\}$ in the Euclidean plane, the Voronoï
@@ -936,11 +969,11 @@ xn yn
triangulation. By default, these points are removed at the end of
the algorithm.
\item[color = \meta{value} (default: black):] The color of the
- drawing.
+ drawing of the Delaunay mesh.
\item[colorBbox = \meta{value} (default: black):] The color of the
drawing for the elements (points and triangles) belonging to the
bounding box.
-\item[colorVoronoi = \meta{value} (default: black):] The color of the
+\item[colorVoronoi = \meta{value} (default: red):] The color of the
drawing for the elements (points and polygons) belonging to the
Voronoï diagram.
\item[print = none (default) \textme{or} points:] To label the
@@ -970,17 +1003,28 @@ xn yn
allows to draw the Delaunay triangulation in dashed lines.
\item[styleVoronoi = none (default) \textme{or} dashed:] This option
allows to draw the Voronoï edges in dashed lines.
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh (if plotted). It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessVoronoi = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the Voronoï diagram. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
\begin{Exemple}
- \buildVoronoiBW[tikz,delaunay=show,styleDelaunay=dashed]
+ \buildVoronoiBW[tikz,
+ delaunay=show,
+ styleDelaunay=dashed,
+ thickness = 1pt,
+ thicknessVoronoi=2pt]
{(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);(0.1,2);(1.5,-0.3)}
\end{Exemple}
\subsection{The \emph{inc} variant}
Once again, a variant of the macros is available allowing the user to
-add code before and after the code produced by \luamesh. We refer to
+add code before and after the code produced by \luamesh (with the same options
+as the non \emph{inc} command). We refer to
section~\ref{sec:inc} because it works the same way.
Let us note that:
@@ -1001,7 +1045,7 @@ available (see~\ref{sec:mpcolor}): \Verb+\luameshmpcolorVoronoi+.
\section{With Gmsh}
-Gmsh is an open source efficient software that produces meshes. The
+Gmsh~\cite{gmsh} is an open source efficient software that produces meshes. The
exporting format is the \emph{MSH ASCII file format} and can be easily
read by a Lua program. \luamesh provides the user with dedicated
macros to read and draw meshes coming from a Gmsh exportation.\bigskip
@@ -1045,10 +1089,13 @@ There are several options to customize the drawing.
the scale at which the picture is drawn (the same for both
axes). It must contain the unit of length (cm,
pt, etc.).
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
Here is an example:
\begin{Exemple}
- \drawGmsh[scale=2cm,print=points, color=blue!30]{maillage.msh}
+ \drawGmsh[scale=2cm,print=points, color=blue!30,thickness=0.8pt]{maillage.msh}
\end{Exemple}
\subsection{Gmsh and Voronoï Diagrams}
@@ -1069,8 +1116,8 @@ Voronoï diagram. This is done by the following macro:\bigskip
There are several options to customize the drawing.
\begin{optionsenum}
\item[color = \meta{value} (default: black):] The color of the
- drawing.
-\item[colorVoronoi = \meta{value} (default: black):] The color of the
+ drawing of the Delaunay mesh.
+\item[colorVoronoi = \meta{value} (default: red):] The color of the
drawing for the elements (points and polygons) belonging to the
Voronoï diagram.
\item[print = none (default) \textme{or} points:] To label the vertices of the
@@ -1100,16 +1147,28 @@ There are several options to customize the drawing.
allows to draw the Delaunay triangulation in dashed lines.
\item[styleVoronoi = none (default) \textme{or} dashed] This option
allows to draw the Voronoï edges in dashed lines.
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh (if plotted). It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessVoronoi = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the Voronoï diagram. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
\begin{Exemple}
- \gmshVoronoi[tikz,scale=3cm, delaunay=show,styleVoronoi=dashed]{maillagev4.msh}
+ \gmshVoronoi[tikz,
+ scale=4cm,
+ delaunay=show,
+ styleVoronoi=dashed,
+ thickness=0.4pt,
+ thicknessVoronoi=2pt
+ ]{maillagev4.msh}
\end{Exemple}
\subsection{The \emph{inc} variants}
-Once again, there exist \emph{inc} variant macros:\bigskip
+Once again, there exist \emph{inc} variant macros (with the same options):\bigskip
\commande|\drawGmshinc[«options»]{«file name»}{«code before»}{«code after»}|\medskip
@@ -1118,13 +1177,38 @@ Once again, there exist \emph{inc} variant macros:\bigskip
We refer to the previous sections for explanations.
+\section{\texttt{mplibcode} environments}
+
+All the \Verb+mplibcode+ environments produced by this package use instance
+mechanism provided by the \Verb+luamplib+ package~\cite{luamplib}. The name of
+the instance is \verb+luamesh+.
+
+\subsection{A MetaPost package}
+
+This package comes with a \Verb+luamesh.mp+ file. This file provide for the
+moment only one macro to draw circumscribed circles of three points. All of the
+\Verb+luamesh+ instances of \Verb+mplibcode+ environments include the MetaPost
+\Verb+luamesh.mp+ package.
+\bigskip
+
+\commande|circumcircle(«pair1»,«pair2»,«pair3»)|\medskip
+
+This macro returns a \Verb+path+: the circumscribed circle passing by the three
+argument \Verb+pair+s.\footnote{For the tikz users, we refer to
+ \texttt{tkz-euclide}~\cite{tkzeuclide} package that provides a large number of tools including
+ on to draw circumscribed circles.}
+
+\begin{Exemple}
+\buildVoronoiBWinc{(0, 0);(6,0);(2,4);(1.5,2);(2.,0.5);(3,2.6);(3.5,1);(5,3.);(0.3,3.2)}{beginfig(0);}{draw circumcircle(MeshPoints1,MeshPoints2,MeshPoints3);endfig;}
+\end{Exemple}
+
\section{Gallery}
\subsection{With Animate}
-If you use \emph{Adobe Acrobat reader}, you can easily produce an
+If you use \emph{Adobe Acrobat reader} or \emph{Okular}, you can easily produce an
animation of the Bowyer and Watson algorithm with the package
-\Verb+animate+.
+\Verb+animate+~\cite{animate}.
For example, the following code (in a file name \Verb+animation.tex+):
\begin{latexcode}
@@ -1225,6 +1309,8 @@ using the \Verb+animate+ package.
\section{History}
\begin{itemize}
+\item July, 2022, v~0.7, adding of thickness options, creation of the MetaPost
+ package, and improvement of the documentation.
\item June, 6th, 2020, v 0.6, correction of bug produced by the
deleted \Verb+\mplibcolor+ function of \Verb+luamplib+ package.
\item June, 6th, 2020, v 0.6, add support of version 4 of the
@@ -1232,7 +1318,7 @@ using the \Verb+animate+ package.
\end{itemize}
-\input{dum.bbl}
+\printbibliography
\end{document}