1 % luamesh: compute and draw meshes with lua, luamplib and tikz
3 % Originally written by Maxime Chupin <mc@melusine.eu.org>,
6 % Distributed under the terms of the GNU free documentation licence:
7 % http://www.gnu.org/licenses/fdl.html
8 % without any invariant section or cover text.
10 \documentclass{lltxdoc
}
11 \usepackage{tcolorbox
}
12 \title{\Verb+luamesh+: compute and draw meshes with
\lualatex}
13 \author{Maxime Chupin
\email{mc@melusine.eu.org
}}
18 \tcbuselibrary{listings,breakable
}
20 \definecolor{vert
}{rgb
}{0.1,
0.4,
0.1}
21 \definecolor{bleu
}{rgb
}{0.1,
0.1,
0.4}
23 numberstyle=
\footnotesize\color{vert
},
24 keywordstyle=
\ttfamily\bfseries\color{blue
},
25 basicstyle=
\ttfamily\footnotesize,
26 commentstyle=
\itshape\color{vert
},
27 stringstyle=
\ttfamily,
28 showstringspaces=false,
32 defaultdialect=
[LaTeX
]TeX,
36 \lstdefinelanguage{lua
}
37 {morekeywords=
{for,end,function,do,if,else,elseif,then,
38 tex.print,tex.sprint,io.read,io.open,string.find,string.explode,require
},
40 morecomment=
[s
]{--
[[}{]]},
44 \newtcblisting{Exemple
}{%
45 arc=
0pt,outer arc=
0pt,
47 colframe=red!
75!black,
49 boxsep=
0pt,left=
5pt,right=
5pt,top=
5pt,bottom=
5pt, bottomtitle =
51 boxrule=
0pt,bottomrule=
0.5pt,toprule=
0.5pt, toprule at break =
52 0pt, bottomrule at break =
0pt,
53 listing options=
{breaklines
},
56 \newtcblisting{commandshell
}{colback=black,colupper=white,colframe=black,
58 listing only,boxsep=
0pt,listing
59 options=
{style=tcblatex,language=sh
},
60 every listing line=
{\textcolor{red
}{\small\ttfamily\bfseries user \$>
}}}
62 \newtcblisting{latexcode
}{
64 listing only,boxsep=
0pt,listing
65 options=
{style=tcblatex
}}
68 \newcommand\luamesh{\Verb+luamesh+
\xspace}
75 The package
\Verb|luamesh| allows to compute and draw triangulation
76 of Delaunay. The algorithm is written with lua, and depending of the
77 choice of the ``engine'', the draw is done by MetaPost (with
78 \Verb|luamplib|) or by
\Verb|tikz|.
80 The Delaunay triangulation algorithm is the Bowyer and Watson
81 algorithm. Several macros are provided to draw the global mesh, the
82 set of points, a particular step of the algorithm.
85 \section{Installation
}
87 \subsection{With Linux
}
89 To install
\luamesh with
\TeX live, you have to create the local
90 \Verb+texmf+ directory in your
\Verb+home+.
96 Then we have to files to place in the correct directories. First, the
97 \Verb+luamesh.sty+ file must be in the directory:
99 \Verb+~/texmf/tex/latex/luamesh/+
101 and secondly, the
\Verb+luamesh.lua+ must be in the directory:
103 \Verb+~/texmf/scripts/luamesh/+
106 Once you have done this,
\luamesh can be included in your
document
117 \subsection{Draw a Complete Mesh
}
119 \subsection{Draw the Set of Points
}
121 \subsection{Draw a Step of the Bowyer and Watson Algorithm
}
123 \section{Gallery of Examples
}
131 %%% ispell-local-dictionary: "american"