\usepackage{tcolorbox}
\usepackage{xargs}
\usepackage{enumitem}
-
-
+\usepackage[tikz]{bclogo}
+\usepackage{wrapfig}
\title{\Verb+luamesh+: compute and draw meshes with \lualatex}
\author{Maxime Chupin \email{mc@melusine.eu.org}}
\date{\today}
}%
]{Vitem}}
-\newcommand*\textme[1]{\color{black}{\rmfamily\textit{#1}}}
+\newcommand*\textme[1]{\textcolor{black}{\rmfamily\textit{#1}}}
\newcommand*\meta[1]{% % meta
\textme{\ensuremath{\langle}#1\ensuremath{\rangle}}}
\newcommand*\optstar{% % optional star
breaklines=true,
breakindent=30pt,
defaultdialect=[LaTeX]TeX,
- % frame=tb
+ morekeywords={buildMeshBW,buildMeshBWinc,drawPointsMesh,
+ drawPointsMeshinc, meshAddPointBW, meshAddPointBWinc}% frame=tb
}
\lstdefinelanguage{lua}
\newcommand\luamesh{\Verb+luamesh+\xspace}
\newenvironment{optionsenum}[1][]
- {\begin{description}[font=\color{red}\ttfamily]}
- {\end{description}}
+{\begin{description}[font=\color{red}\ttfamily]}
+ {\end{description}}
+
+\newenvironment{warning}{%
+ \setlength{\logowidth}{24pt}
+ \tcbset{%
+ arc=0pt,outer arc=0pt,colback=gray!10!white,colframe=gray!60!white,
+ boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = 3pt, toptitle=3pt,
+ boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt}
+ \medskip
+ \begin{tcolorbox}%
+ \begin{wrapfigure}[2]{L}{17pt}%
+ % \raisebox{-5pt}{
+ \vspace*{-0.55cm}
+ \bcinfo
+ % }%
+ \end{wrapfigure}
+ }%
+ {\end{tcolorbox}\medskip}
+
+
\begin{document}
+%% === Page de garde ===================================================
+\thispagestyle{empty}
+\begin{tikzpicture}[remember picture, overlay]
+ \node[below right, shift={(-4pt,4pt)}] at (current page.north west) {%
+ \includegraphics{fond.pdf}%
+ };
+\end{tikzpicture}%
+
+\noindent
+\includegraphics{luamesh}\\
+{\large compute and draw meshes with \lualatex}\\[1cm]
+\parbox{0.6\textwidth}{
+ \meshAddPointBW[
+ mode=ext,step=badtriangles,
+ colorNew =green!20!red,
+ colorBack=red!10,
+ colorCircle = blue,
+ bbox = show,
+ colorBbox = black!30
+ ]
+ {meshgarde.txt}{7}
+}\hfill
+\parbox{0.4\textwidth}{\Large\raggedleft
+ \textbf{Contributor}\\
+ Maxime \textsc{Chupin}
+}
+\vfill
+\begin{center}
+ Version 0.1, 25 novembre 2016\\
+ \url{http://melusine.eu.org/syracuse/G/delaunay/}
+\end{center}
+%% == Page de garde ====================================================
+\newpage
\maketitle
There are several options to customize the drawing.
\begin{optionsenum}
-\item[\color{red}\texttt{mode = int (default) or ext}:] the mode option allow to
+\item[mode = int (default) 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 :
...
xn yn
\end{verbatim}
+\item[bbox = none (default) 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})$,
+ $(x_{\max},y_{\max})$, and $(x_{\min},y_{\max})$.} 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[print = none (default) 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
+ 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}
+To illustrate the options, let us show you an example. We consider a
+file \Verb+mesh.txt+:
+\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}
+\begin{Exemple}
+ \buildMeshBW[%
+ tikz,
+ mode = ext,
+ bbox = show,
+ color = red,
+ colorBbox = blue!30,
+ print = points,
+ meshpoint = x,
+ scale = 1.3cm,
+ ]{mesh.txt}
+\end{Exemple}
+
+\begin{warning}
+The drawing engine is not here very relevant. But it is useful to
+understand how the drawing is made. However, the engine will make sens
+for the so called \emph{inc} macros (section~\ref{sec:inc}), where we
+will be allowed to add code before and after the generated one by
+\luamesh.
+\end{warning}
+
\subsection{Draw the Set of Points}
-\commande|\tracePointsMesh[«options»]{«list of points» or «file name»}|
+\commande|\drawPointsMesh[«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{The \emph{inc} Macros}\label{sec:inc}
\section{Gallery of Examples}