+\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}
+
+