Inc macro pour meshPolygon, mise à jour de la documentation.
[delaunay.git] / doc / luamesh-doc.tex
index d2cbafd..9074e5f 100644 (file)
 }
 \vfill
 \begin{center}
-  Version 0.2, 29 novembre 2016\\
+  Version 0.5, 2017, February, 9th \\
   \url{http://melusine.eu.org/syracuse/G/delaunay/}
 \end{center}
 %% == Page de garde ====================================================
@@ -218,7 +218,8 @@ Then place the files in the correct directories. The
 \begin{center}
   \Verb+~/texmf/tex/latex/luamesh/+
 \end{center}
-and the \Verb+luamesh.lua+ file must be in directory:
+and 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}
@@ -315,8 +316,10 @@ 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) \textme{or} points:] To label the vertices of the
-  triangulation. This also adds a \emph{dot} at each vertex.
+\item[print = none (default) \textme{or} points \textme{or}
+  dotpoints:] The \Verb+point+ value allows to label the vertices of the
+  triangulation. This also adds a \emph{dot} at each vertex. The
+  \Verb+dotpoints+ value only add a dot without the labeling.
 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
   label the vertices of the triangulation. It is included in the math
   mode delimiters \Verb+$...$+. The bounding box points are labeled
@@ -562,6 +565,100 @@ We draw the addition of the 6th point. The 7th line will be ignored.
   {mesh.txt}{6}
 \end{Exemple}
 
+\subsection{Mesh a Polygon}
+
+\commande|\meshPolygon[«options»]{«list of points» or «file name»}|\medskip
+
+
+With \luamesh, it is possible to mesh an object giving the
+\emph{border}, \emph{i.e.}, one closed polygon. The polygon is given
+as a list of points as above:
+\begin{center}
+  \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
+\end{center}
+Once again we can also give a file of points using the \Verb+mode+
+option.
+
+This command allows to plot the steps within the building of a complete
+mesh. The followed method is, given a parameter $h$:
+\begin{itemize}
+\item to build a squared grid of points with a unit distance equal to
+  $h$;
+\item to keep the grid points inside the polygon;
+\item if necessary to add points along the polygon to respect the
+  distance parameter;
+\item to mesh the complete set of points (using the Bowyer and Watson
+  algorithm).
+\end{itemize}
+
+One can use the macro as follows:
+\begin{Exemple}
+  \meshPolygon[step=polygon,scale=2cm]{(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
+  \meshPolygon[step=grid,scale=2cm]{(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
+  \meshPolygon[step=points,scale=2cm]{(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
+  \meshPolygon[step=mesh,scale=2cm]{(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
+\end{Exemple}
+
+Note that if the points of the grid are too closed to the points of
+the refined boundary, they are ejected.
+
+\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 points as the argument, or
+  a file containing the points line by line (in 2 columns). Such a
+  file looks like :
+\begin{verbatim}
+x1  y1
+x2  y2
+x3  y3
+...
+xn yn
+\end{verbatim}
+\item[h = \meta{value} (default: 0.2):] The mesh parameter, it is the
+  unit distance for the grid. If necessary, the boundary is refined to
+  get points which respect the distance constrain.
+\item[color = \meta{value} (default: black):] The color of the
+  drawing (the grid point and the mesh).
+\item[colorPolygon = \meta{value} (default: red):] The color of the
+  drawing for the boundary polygon.
+\item[print = none (default) \textme{or} points \textme{or}
+  dotpoints:] The \Verb+point+ value allows to label the vertices of the
+  triangulation. This also adds a \emph{dot} at each vertex. The
+  \Verb+dotpoints+ value only add a dot without the labeling.
+\item[meshpoint = \meta{value} (default: P):] The letter(s) used to
+  label the vertices of the triangulation. It is included in the math
+  mode delimiters \Verb+$...$+.
+\item[step = polyqon  \textme{or} grid \textme{or}
+  points \textme{or} mesh (default):] To choose the step we want to draw,
+  see the description above.
+\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, \Verb+tikz+  is the \textit{drawing
+    engine}.
+\item[scale = \meta{value} (default: 1cm):] The scale option defines
+  the scale at which the picture is drawn (the same for both
+  axis). It must contain the unit of length (cm,
+  pt, etc.).
+\end{optionsenum}
+
+Here is an example of customizing the drawing.
+\begin{Exemple}
+  \meshPolygon[
+  tikz,
+  color = blue!70,
+  meshpoint = \alpha,
+  colorPolygon=red!120,
+  scale=4cm,
+  step=mesh,
+  print=points]
+  {(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
+\end{Exemple}
+
+
 \section{The \emph{inc} Macros}\label{sec:inc}
 
 The three macros presented in the above sections have complementary
@@ -625,7 +722,8 @@ and \Verb+\luameshmpcolorBbox+ have been defined.
 For the macro \Verb+\meshAddPointBWinc+ three additional
 colors are present: \Verb+\luameshmpcolorBack+,
 \Verb+\luameshmpcolorNew+, and
-\Verb+\luameshmpcolorCircle+. Of course, MetaPost
+\Verb+\luameshmpcolorCircle+. For the macro \Verb+\meshPolygon+, the
+color \Verb+\luameshmpcolorPoly+ is defined. Of course, MetaPost
 colors can be defined as well. Finally, the \Verb+luamplib+ mechanism
 \Verb+\mpcolor+ is also available.
 
@@ -639,6 +737,10 @@ the mesh (when the option \Verb+bbox=show+, the last 4 points are the
 \Verb+MeshPoints[i]+ are
 defined using the unit length \Verb+u+.
 
+With the \Verb+\meshPolygon+ macro, we have the points of the polygon
+(refined) that are available with the
+\Verb+polygon[]+ table of variables.
+
 \subsubsection{Examples}
 
 Here is three examples for the different macros.
@@ -731,6 +833,12 @@ The mesh points  are defined here as \Verb+tikz+
 %etc.
 \end{latexcode}
 
+With the \Verb+\meshPolygon+ we have also the polygon points coordinates:
+\begin{latexcode}
+\coordinate (polygon1) at (...,...);
+%etc.
+\end{latexcode}
+
 Once again these coordinates are not yet defined to be used in the
 code given by \meta{code
   before} argument.
@@ -880,7 +988,6 @@ Let us note that:
 Finally, when the MetaPost drawing engine is used another color is
 available (see~\ref{sec:mpcolor}): \Verb+\luameshmpcolorVoronoi+.
 
-
 \section{With Gmsh}
 
 Gmsh is an open source efficient software that produces meshes. The
@@ -991,6 +1098,8 @@ Once again, there exist \emph{inc} variant macros:\bigskip
 
 We refer to the previous sections for explanations.
 
+
+
 \section{Gallery}
 \subsection{With Animate}
 

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.