Perturbation aléatoire des points de la grille rectangulaire pour meshPolygon, option...
[delaunay.git] / doc / luamesh-doc.tex
1 % luamesh: compute and draw meshes with lua, luamplib and tikz
2 %
3 % Originally written by Maxime Chupin <mc@melusine.eu.org>,
4 % 2010.
5 %
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.
9
10 \documentclass{lltxdoc}
11 \usepackage{tcolorbox}
12 \usepackage{enumitem}
13 \usepackage[tikz]{bclogo}
14 \usepackage{wrapfig}
15 \usepackage{animate}
16
17 \title{\Verb+luamesh+: compute and draw meshes with \lualatex}
18 \author{Maxime Chupin \email{mc@melusine.eu.org}}
19 \date{\today}
20
21
22 \definecolor{darkred}{rgb}{0.8,0.1,0.1}
23
24
25 \newcommand*\commande{\noindent\hspace{-30pt}%
26 \SaveVerb[aftersave={%
27 \UseVerb{Vitem}
28 }%
29 ]{Vitem}}
30
31 \newcommand*\textme[1]{\textcolor{black}{\rmfamily\textit{#1}}}
32 \newcommand*\meta[1]{% % meta
33 \textme{\ensuremath{\langle}#1\ensuremath{\rangle}}}
34 \newcommand*\optstar{% % optional star
35 \meta{\ensuremath{*}}\xspace}
36 \DefineShortVerb{\|}
37 \newcommand\R{\mathbf{R}}
38 \setlength{\fboxsep}{2pt}
39 \fvset{%
40 codes={\catcode`\«\active \catcode`\×\active },
41 defineactive={\makefancyog\makefancytimes},
42 formatcom=\color{darkred},
43 frame=single
44 }
45 % rendre «...» équivalent à \meta{...}
46 {\catcode`\«\active
47 \newcommandx\makefancyog[0][addprefix=\global]{%
48 \def«##1»{\meta{##1}}}}
49 % rendre × équivalent à \optstar
50 {\catcode`\×\active
51 \newcommandx\makefancytimes[0][addprefix=\global]{%
52 \def×{\optstar{}}}}
53
54
55 \tcbuselibrary{listings,breakable}
56
57 \definecolor{vert}{rgb}{0.1,0.4,0.1}
58 \definecolor{bleu}{rgb}{0.1,0.1,0.4}
59 \lstset{
60 numberstyle=\footnotesize\color{vert},
61 keywordstyle=\ttfamily\bfseries\color{blue},
62 basicstyle=\ttfamily\footnotesize,
63 commentstyle=\itshape\color{vert},
64 stringstyle=\ttfamily,
65 showstringspaces=false,
66 language=[LaTeX]TeX,
67 breaklines=true,
68 breakindent=30pt,
69 defaultdialect=[LaTeX]TeX,
70 morekeywords={buildMeshBW,buildMeshBWinc,drawPointsMesh,buildVoronoiBW,buildVoronoiBWinc,
71 drawPointsMeshinc, meshAddPointBW,
72 meshAddPointBWinc,drawGmsh,drawGmshinc,gmshVoronoi,gmshVoronoiinc}% frame=tb
73 }
74
75 \lstdefinelanguage{lua}
76 {morekeywords={for,end,function,do,if,else,elseif,then,
77 tex.print,tex.sprint,io.read,io.open,string.find,string.explode,require},
78 morecomment=[l]{--},
79 morecomment=[s]{--[[}{]]},
80 morestring=[b]''
81 }
82
83 \newtcblisting{Exemple}{%
84 arc=0pt,outer arc=0pt,
85 colback=red!2!white,
86 colframe=red!75!black,
87 breakable,
88 boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle =
89 3pt, toptitle=3pt,
90 boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break =
91 0pt, bottomrule at break = 0pt,
92 listing options={breaklines},
93 }
94
95 \newtcblisting{commandshell}{colback=black,colupper=white,colframe=black,
96 arc=0pt,
97 listing only,boxsep=0pt,listing
98 options={style=tcblatex,language=sh},
99 every listing line={\textcolor{red}{\small\ttfamily\bfseries user \$> }}}
100
101 \newtcblisting{latexcode}{
102 arc=0pt,outer arc=0pt,
103 colback=red!2!white,
104 colframe=red!75!black,
105 breakable,
106 boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle =
107 3pt, toptitle=3pt,
108 boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break =
109 0pt, bottomrule at break = 0pt,
110 listing only,boxsep=0pt,listing
111 options={breaklines}
112 }
113
114
115 \newcommand\luamesh{\Verb+luamesh+\xspace}
116
117 \newenvironment{optionsenum}[1][]
118 {\begin{description}[font=\color{darkred}\ttfamily]}
119 {\end{description}}
120
121 \newenvironment{warning}{%
122 \setlength{\logowidth}{24pt}
123 \tcbset{%
124 arc=0pt,outer arc=0pt,colback=gray!10!white,colframe=gray!60!white,
125 boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = 3pt, toptitle=3pt,
126 boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt}
127 \medskip
128 \begin{tcolorbox}%
129 \begin{wrapfigure}[2]{L}{17pt}%
130 % \raisebox{-5pt}{
131 \vspace*{-0.55cm}
132 \bcinfo
133 % }%
134 \end{wrapfigure}
135 }%
136 {\end{tcolorbox}\medskip}
137
138 \lstset{moredelim=*[s][\color{red}\rmfamily\itshape]{<}{>}}
139 \lstset{moredelim=*[s][\color{blue}\rmfamily\itshape]{<<}{>>}}
140 \usepackage[colorlinks=true]{hyperref}
141 \begin{document}
142 %% === Page de garde ===================================================
143 \thispagestyle{empty}
144 \begin{tikzpicture}[remember picture, overlay]
145 \node[below right, shift={(-4pt,4pt)}] at (current page.north west) {%
146 \includegraphics{fond.pdf}%
147 };
148 \end{tikzpicture}%
149
150 \noindent
151 \includegraphics{luamesh-title}\\
152 {\large compute and draw meshes with \lualatex}\\[1cm]
153 \parbox{0.6\textwidth}{
154 \meshAddPointBW[
155 mode=ext,step=badtriangles,
156 colorNew =green!20!red,
157 colorBack=red!10,
158 colorCircle = blue,
159 bbox = show,
160 colorBbox = black!30
161 ]
162 {meshgarde.txt}{7}
163 }\hfill
164 \parbox{0.4\textwidth}{\Large\raggedleft
165 \textbf{Contributor}\\
166 Maxime \textsc{Chupin}
167 }
168 \vfill
169 \begin{center}
170 Version 0.5, 2017, February, 9th \\
171 \url{http://melusine.eu.org/syracuse/G/delaunay/}
172 \end{center}
173 %% == Page de garde ====================================================
174 \newpage
175
176 \maketitle
177
178 \begin{abstract}
179 The package \Verb|luamesh| allows to compute and draw 2D Delaunay
180 triangulation. The algorithm is written with lua, and depending on the
181 choice of the ``engine'', the drawing is done by MetaPost (with
182 \Verb|luamplib|) or by \Verb|tikz|.
183
184 The Delaunay triangulation algorithm is the Bowyer and Watson
185 algorithm. Several macros are provided to draw the global mesh, the
186 set of points, or a particular step of the algorithm.
187 \end{abstract}
188
189 I would like to thank Jean-Michel Sarlat, who hosts the development
190 with a git project on the \Verb+melusine+ machine:
191 \begin{center}
192 \url{https://melusine.eu.org/syracuse/G/delaunay/}
193 \end{center}
194 I would also like to thank the first user, an intensive
195 \emph{test} user, and a very kind English corrector: Nicole Spillane.
196
197 \tableofcontents
198
199 \section{Installation}
200
201
202 Of course, you can just put the two files \Verb+luamesh.lua+ and
203 \Verb+luamesh.sty+ in the working directory but this is not
204 recommended.
205
206
207 \subsection{With \TeX live and Linux or Mac OSX}
208
209 To install \luamesh with \TeX live, you have to create the local
210 \Verb+texmf+ directory in your \Verb+home+.
211
212 \begin{commandshell}
213 mkdir ~/texmf
214 \end{commandshell}
215
216 Then place the files in the correct directories. The
217 \Verb+luamesh.sty+ file must be in directory:
218 \begin{center}
219 \Verb+~/texmf/tex/latex/luamesh/+
220 \end{center}
221 and the \Verb+luamesh.lua+, the \Verb+luamesh-tex.lua+ and the
222 \Verb-luamesh-polygon.lua+ files must be in directory:
223 \begin{center}
224 \Verb+~/texmf/scripts/luamesh/+
225 \end{center}
226
227 Once you have done this, \luamesh can be included in your document
228 with
229 \begin{latexcode}
230 \usepackage{luamesh}
231 \end{latexcode}
232
233 \subsection{With Mik\TeX{} and Windows}
234
235 As these two systems are unknown to the contributor, we refer to the
236 documentation for integrating local additions to Mik\TeX:
237 \begin{center}
238 \url{http://docs.miktex.org/manual/localadditions.html}
239 \end{center}
240
241
242 \subsection{A \lualatex package}
243
244 If you want to use this package, you must compile your document with
245 \Verb+lualatex+:
246
247 \begin{commandshell}
248 lualatex mylatexfile.tex
249 \end{commandshell}
250
251
252 \subsection{Dependencies}
253
254 This package is built upon two main existing packages that one used to
255 draw the
256 triangulations :
257 \begin{enumerate}
258 \item \Verb+luamplib+ to use MetaPost via the \luatex library
259 \Verb+mplib+;
260 \item \Verb+tikz+.
261 \end{enumerate}
262 We will see how to choose between these two \emph{drawing engines}.
263 Moreover, the following packages are necessary:
264 \begin{enumerate}
265 \item \Verb+xkeyval+ to manage the optional arguments;
266 \item \Verb+xcolor+ to use colors (required by \Verb+luamplib+);
267 \item \Verb+ifthen+ to help programming with \TeX.
268 \end{enumerate}
269
270
271 \section{The Basic Macros}
272
273 This package provides macros to draw two
274 dimensional triangulations (or meshes).
275
276 \subsection{Draw a Complete Mesh}\label{sec:buildMesh}
277
278 \commande|\buildMeshBW[«options»]{«list of points» or «file name»}|\medskip
279
280 This macro produces the Delaunay triangulation (using the Bowyer and
281 Watson algorithm) of the given \meta{list of points}. The list of
282 points must be given in the following way :
283 \begin{center}
284 \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
285 \end{center}
286
287 \begin{Exemple}
288 \buildMeshBW{(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)}
289 \end{Exemple}
290
291 \subsubsection{The Options}
292
293 There are several options to customize the drawing.
294 \begin{optionsenum}
295 \item[mode = int (default) \textme{or} ext:] this option allows to
296 use either the previously described set of points in the argument, or
297 a file containing the points line by line (in 2 columns). Such a
298 file looks like :
299 \begin{verbatim}
300 x1 y1
301 x2 y2
302 x3 y3
303 ...
304 xn yn
305 \end{verbatim}
306 \item[bbox = none (default) \textme{or} show:] this option allows to draw the
307 points added to form the \emph{bounding box}\footnote{The bounding
308 box is defined by four points place at 15\% around the box
309 defined by $(x_{\min},y_{\min})$, $(x_{\min},y_{\max})$,
310 $(x_{\max},y_{\max})$, and $(x_{\min},y_{\max})$. It is used by
311 the algorithm and will be computed in any case.} and the
312 triangles attached. By default, these triangles are removed at the end of
313 the algorithm.
314 \item[color = \meta{value} (default: black):] The color of the
315 drawing.
316 \item[colorBbox = \meta{value} (default: black):] The color of the
317 drawing for the elements (points and triangles) belonging to the
318 bounding box.
319 \item[print = none (default) \textme{or} points \textme{or}
320 dotpoints:] The \Verb+point+ value allows to label the vertices of the
321 triangulation. This also adds a \emph{dot} at each vertex. The
322 \Verb+dotpoints+ value only add a dot without the labeling.
323 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
324 label the vertices of the triangulation. It is included in the math
325 mode delimiters \Verb+$...$+. The bounding box points are labeled
326 with numbers 1 to 4 and with a star exponent.
327 \item[tikz (boolean, default:false):] By default, this boolean is set
328 to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
329 the picture. With this option, \Verb+tikz+ becomes the \textit{drawing
330 engine}.
331 \item[scale = \meta{value} (default: 1cm):] The scale option defines
332 the scale at which the picture is drawn (the same for both
333 axes). It must contain the unit of length (cm,
334 pt, etc.).
335 \end{optionsenum}
336
337 To illustrate the options, let us show you an example. We consider a
338 file \Verb+mesh.txt+:
339 \begin{verbatim}
340 0.3 0.3
341 1.5 1
342 4 0
343 4.5 2.5
344 1.81 2.14
345 2.5 0.5
346 2.8 1.5
347 \end{verbatim}
348 \begin{Exemple}
349 \buildMeshBW[%
350 tikz,
351 mode = ext,
352 bbox = show,
353 color = red,
354 colorBbox = blue!30,
355 print = points,
356 meshpoint = x,
357 scale = 1.3cm,
358 ]{mesh.txt}
359 \end{Exemple}
360
361 \begin{warning}
362 The drawing engine is not very relevant here, although it is useful to
363 understand how the drawing is produced. However, the engine will be
364 relevant to
365 the so called \emph{inc} macros (section~\ref{sec:inc}) for adding
366 code before and after the one generated by
367 \luamesh.
368 \end{warning}
369
370 \subsection{Draw the Set of Points}
371
372 \commande|\drawPointsMesh[«options»]{«list of points» or «file name»}|\medskip
373
374 With the \Verb+\drawPointsMesh+, we plot the set of (user chosen) points from
375 which the Bowyer and Watson algorithm computes the triangulation.
376
377 The use of this macro is quite similar to
378 \Verb+\buildMeshBW+. Here is an example of the basic uses.
379 \begin{Exemple}
380 \drawPointsMesh{(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)}
381 \end{Exemple}
382
383
384 \subsubsection{The Options}
385
386 There are several options (exactly the same as for the
387 \Verb+\buildMeshBW+) to customize the drawing.
388 \begin{optionsenum}
389 \item[mode = int (default) \textme{or} ext:] this option allows to
390 use either the previously described set of points as the argument, or
391 a file containing the points line by line (in 2 columns). Such a
392 file looks like :
393 \begin{verbatim}
394 x1 y1
395 x2 y2
396 x3 y3
397 ...
398 xn yn
399 \end{verbatim}
400 \item[bbox = none (default) \textme{or} show:] this option allows to draw the
401 points added to form the \emph{bounding box}\footnote{The bounding
402 box is defined by four points place at 15\% around the box
403 defined by $(x_{\min},y_{\min})$, $(x_{\min},y_{\max})$,
404 $(x_{\max},y_{\max})$, and $(x_{\min},y_{\max})$. It is used by
405 the algorithm and will be computed in any case.} and the
406 triangles attached. By default, these triangles are removed at the end of
407 the algorithm. \emph{Here, because we plot only the vertices of the
408 mesh, there are no triangles, only dots.}
409 \item[color = \meta{value} (default: black):] The color of the
410 drawing.
411 \item[colorBbox = \meta{value} (default: black):] The color of the
412 drawing for the elements (points and triangles) belonging to the
413 bounding box.
414 \item[print = none (default) \textme{or} points:] To label the vertices of the
415 triangulation. This also adds a \emph{dot} at each vertex. With no
416 label, the dot remains.
417 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
418 label the vertices of the triangulation. This is included in the math
419 mode delimiters \Verb+$...$+. The bounding box points are labeled
420 with numbers 1 to 4 and with a star exponent.
421 \item[tikz (boolean, default:false):] By default, this boolean is set
422 to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
423 the picture. With this option, \Verb+tikz+ becomes the \textit{drawing
424 engine}.
425 \item[scale = \meta{value} (default: 1cm):] The scale option defines
426 the scale at which the picture is drawn (the same for both
427 axes). It must contain the unit of length (cm,
428 pt, etc.).
429 \end{optionsenum}
430 With the same external mesh point file presented in
431 section~\ref{sec:buildMesh}, we illustrate the different options.
432
433 \begin{Exemple}
434 \drawPointsMesh[%
435 tikz,
436 mode = ext,
437 bbox = show,
438 color = blue,
439 colorBbox = red,
440 print = points,
441 meshpoint = y,
442 scale = 1.3cm,
443 ]{mesh.txt}
444 \end{Exemple}
445
446
447 \subsection{Draw a Step of the Bowyer and Watson Algorithm}
448
449 \commande|\meshAddPointBW[«options»]{«list of points» or «file name»}{«point» or «number of line»}|\medskip
450
451 This command allows to plot the steps within the addition of a
452 point in a Delaunay triangulation by the Bowyer and Watson
453 algorithm.
454
455 This macro produces the Delaunay triangulation (using the Bowyer and
456 Watson algorithm) of the given \meta{list of points} and shows a step
457 of the algorithm when the \meta{point} is added. The list of
458 points must be given in the following way:
459 \begin{center}
460 \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
461 \end{center}
462 and the point is of the form \verb+(x,y)+. The \meta{file name}
463 and \meta{number of line} will be explained in the option
464 description.
465
466 One can use the macro as follows:
467 \begin{Exemple}
468 \meshAddPointBW[step=badtriangles]{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
469 \meshAddPointBW[step=cavity]{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
470 \meshAddPointBW[step=newtriangles]{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
471 \end{Exemple}
472 The default value for \Verb+step+ is
473 \Verb+badtriangles+. Consequently, the first
474 line is equivalent to
475 \begin{latexcode}
476 \meshAddPointBW{(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}{(2.2,1.8)}
477 \end{latexcode}
478
479 \subsubsection{The Options}
480
481 There are several options (some of them are the same as for
482 \Verb+\buildMeshBW+) to customize the drawing.
483 \begin{optionsenum}
484 \item[mode = int (default) \textme{or} ext:] this option allows to
485 use either the previously described set of points as the argument, or
486 a file containing the points line by line (in 2 columns). Such a
487 file looks like :
488 \begin{verbatim}
489 x1 y1
490 x2 y2
491 x3 y3
492 ...
493 xn yn
494 \end{verbatim}
495 For the second argument of the macro, if we are in
496 \Verb+mode = ext+, the argument must be the \emph{line number} of the file
497 corresponding to the point we want to add. The algorithm will stop at the
498 previous line to build the initial triangulation and proceed to add
499 the point corresponding to the line requested. The subsequent lines in
500 the file are
501 ignored.
502 \item[bbox = none (default) \textme{or} show:] this option allows to draw the
503 added points that form the \emph{bounding box} and the triangles
504 attached. Although they are always computed, by default, these
505 triangles are removed at the end of
506 the algorithm.
507 \item[color = \meta{value} (default: black):] The color of the
508 drawing.
509 \item[colorBbox = \meta{value} (default: black):] The color of the
510 drawing for the elements (points and triangles) belonging to the
511 bounding box.
512 \item[colorNew = \meta{value} (default: red):] The color of the
513 drawing of the ``new'' elements which are the point to add, the
514 polygon delimiting the cavity, and the new triangles.
515 \item[colorBack = \meta{value} (default: black!20):] The color for the
516 filling of the region concerned by the addition of the new point.
517 \item[colorCircle = \meta{value} (default: green):] The color for
518 the circumcircle of the triangles containing the point to add.
519 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
520 label the vertices of the triangulation. It is included in the math
521 mode delimiters \Verb+$...$+. The bounding box points are labeled
522 with numbers 1 to 4 and with a star exponent.
523 \item[step = badtriangles (default) \textme{or} cavity \textme{or}
524 newtriangles:] To choose the step we want to draw, corresponding to
525 the steps of the Bowyer and Watson algorithm.
526 \item[newpoint = \meta{value} (default: P):] The letter(s) used to
527 label the new point of the triangulation. It is include in the math
528 mode delimiters \Verb+$...$+.
529 \item[tikz (boolean, default:false):] By default, this boolean is set
530 to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
531 the picture. With this option, \Verb+tikz+ is the \textit{drawing
532 engine}.
533 \item[scale = \meta{value} (default: 1cm):] The scale option defines
534 the scale at which the picture is drawn (the same for both
535 axis). It must contain the unit of length (cm,
536 pt, etc.).
537 \end{optionsenum}
538
539 Here is an example of customizing the drawing. First, recall that
540 the external file \Verb+mesh.txt+ is:
541 \begin{verbatim}
542 0.3 0.3
543 1.5 1
544 4 0
545 4.5 2.5
546 1.81 2.14
547 2.5 0.5
548 2.8 1.5
549 \end{verbatim}
550 We draw the addition of the 6th point. The 7th line will be ignored.
551 \begin{Exemple}
552 \meshAddPointBW[
553 tikz,
554 mode = ext,
555 color = blue!70,
556 meshpoint = \alpha,
557 newpoint = y,
558 colorBack=red!10,
559 colorNew = green!50!red,
560 colorCircle = blue,
561 colorBbox = black!20,
562 bbox = show,
563 scale=1.4cm,
564 step=badtriangles]
565 {mesh.txt}{6}
566 \end{Exemple}
567
568 \subsection{Mesh a Polygon}
569
570 \commande|\meshPolygon[«options»]{«list of points» or «file name»}|\medskip
571
572
573 With \luamesh, it is possible to mesh an object giving the
574 \emph{border}, \emph{i.e.}, one closed polygon. The polygon is given
575 as a list of points as above:
576 \begin{center}
577 \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
578 \end{center}
579 Once again we can also give a file of points using the \Verb+mode+
580 option.
581
582 This command allows to plot the steps within the building of a complete
583 mesh. The followed method is, given a parameter $h$:
584 \begin{itemize}
585 \item to build a squared grid of points with a unit distance equal to
586 $h$;
587 \item to keep the grid points inside the polygon;
588 \item if necessary to add points along the polygon to respect the
589 distance parameter;
590 \item to mesh the complete set of points (using the Bowyer and Watson
591 algorithm).
592 \end{itemize}
593
594 One can use the macro as follows:
595 \begin{Exemple}
596 \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)}
597 \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)}
598 \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)}
599 \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)}
600 \end{Exemple}
601
602 Note that if the points of the grid are too closed to the points of
603 the refined boundary, they are ejected.
604
605 \subsubsection{The Options}
606
607 There are several options (some of them are the same as for
608 \Verb+\buildMeshBW+) to customize the drawing.
609 \begin{optionsenum}
610 \item[mode = int (default) \textme{or} ext:] this option allows to
611 use either the previously described set of points as the argument, or
612 a file containing the points line by line (in 2 columns). Such a
613 file looks like :
614 \begin{verbatim}
615 x1 y1
616 x2 y2
617 x3 y3
618 ...
619 xn yn
620 \end{verbatim}
621 \item[h = \meta{value} (default: 0.2):] The mesh parameter, it is the
622 unit distance for the grid. If necessary, the boundary is refined to
623 get points which respect the distance constrain.
624 \item[color = \meta{value} (default: black):] The color of the
625 drawing (the grid point and the mesh).
626 \item[colorPolygon = \meta{value} (default: red):] The color of the
627 drawing for the boundary polygon.
628 \item[print = none (default) \textme{or} points \textme{or}
629 dotpoints:] The \Verb+point+ value allows to label the vertices of the
630 triangulation. This also adds a \emph{dot} at each vertex. The
631 \Verb+dotpoints+ value only add a dot without the labeling.
632 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
633 label the vertices of the triangulation. It is included in the math
634 mode delimiters \Verb+$...$+.
635 \item[step = polygon \textme{or} grid \textme{or}
636 points \textme{or} mesh (default):] To choose the step we want to draw,
637 see the description above.
638 \item[tikz (boolean, default:false):] By default, this boolean is set
639 to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
640 the picture. With this option, \Verb+tikz+ is the \textit{drawing
641 engine}.
642 \item[scale = \meta{value} (default: 1cm):] The scale option defines
643 the scale at which the picture is drawn (the same for both
644 axis). It must contain the unit of length (cm,
645 pt, etc.).
646 \item[gridpoints = rect (default) \textme{or} perturb:] This option
647 allows to specify the mode of generation of the grid points. The
648 value \Verb+rect+ produces a simple rectangular grid, and the value
649 \Verb+pertub+ randomly perturbs the rectangular grid.
650 \end{optionsenum}
651
652 Here is an example of customizing the drawing.
653 \begin{Exemple}
654 \meshPolygon[
655 tikz,
656 color = blue!70,
657 meshpoint = \alpha,
658 colorPolygon=red!120,
659 scale=4cm,
660 step=mesh,
661 print=points,
662 gridpoints=perturb]
663 {(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
664 \end{Exemple}
665
666
667 \section{The \emph{inc} Macros}\label{sec:inc}
668
669 The three macros presented in the above sections have complementary
670 macros, with the suffix \Verb+inc+ that allow the user to add code
671 (MetaPost or \Verb+tikz+, depending of the drawing engine) before and
672 after the code generated by \luamesh.
673
674 The three macros are:\medskip
675
676
677 \commande|\buildMeshBWinc[«options»]{«list of points» or «file name»}{«code before»}{«code after»}|\medskip
678
679 \commande|\drawPointsMeshinc[«options»]{«list of points» or «file name»}{«code before»}{«code after»}|\medskip
680
681 \commande|\meshAddPointBWinc[«options»]{«list of points» or «file name»}%|
682
683 \commande| {«point» or «number of line»}{«code before»}{«code after»}|\medskip
684
685 \subsection{With MetaPost}
686
687 We consider the case where the drawing engine is MetaPost (through the
688 \Verb+luamplib+ package).
689
690 The feature is described for the \Verb+\buildMeshBWinc+ but the mechanism
691 and possibilities are exactly the same for all three macros.
692
693 When we use the MetaPost drawing engine, the macros previously
694 described produce a code of the form
695 \begin{latexcode}
696 \begin{luamplib}
697 u:=<scale>;
698 beginfig(0);
699 <code for the drawing>
700 endfig;
701 \end{luamplib}
702 \end{latexcode}
703
704 Then, the arguments \meta{code before} and \meta{code after} are
705 inserted as follows:
706 \begin{latexcode}
707 \begin{luamplib}
708 u:=<scale>;
709 <<code before>>
710 <code for the drawing>
711 <<code after>>
712 \end{luamplib}
713 \end{latexcode}
714 \begin{warning}
715 With the \emph{inc} macros, the user has to add the \Verb+beginfig();+
716 and \Verb+endfig;+ commands to produce a picture. Indeed, this allows
717 to use the \Verb+\everymplib+ command from the \Verb+\luamplib+ package.
718 \end{warning}
719
720 \subsubsection{The \LaTeX{} Colors Inside the MetaPost Code}\label{sec:mpcolor}
721
722 The configurable colors
723 of the \LaTeX{} macro are accessible inside the MetaPost code. For
724 \Verb+\buildMeshBWinc+ and \Verb+\drawPointsMeshinc+,
725 \Verb+\luameshmpcolor+,
726 and \Verb+\luameshmpcolorBbox+ have been defined.
727 For the macro \Verb+\meshAddPointBWinc+ three additional
728 colors are present: \Verb+\luameshmpcolorBack+,
729 \Verb+\luameshmpcolorNew+, and
730 \Verb+\luameshmpcolorCircle+. For the macro \Verb+\meshPolygon+, the
731 color \Verb+\luameshmpcolorPoly+ is defined. Of course, MetaPost
732 colors can be defined as well. Finally, the \Verb+luamplib+ mechanism
733 \Verb+\mpcolor+ is also available.
734
735 \subsubsection{The Mesh Points}
736
737 At the beginning of the automatically generated code, a list of
738 MetaPost \Verb+pair+s are defined corresponding to all the vertices in
739 the mesh (when the option \Verb+bbox=show+, the last 4 points are the
740 \emph{bounding box points}). The points are available with the
741 \Verb+MeshPoints[]+ table of variables. The \Verb+pair+s ($\R^{2}$ points)
742 \Verb+MeshPoints[i]+ are
743 defined using the unit length \Verb+u+.
744
745 With the \Verb+\meshPolygon+ macro, we have the points of the polygon
746 (refined) that are available with the
747 \Verb+polygon[]+ table of variables.
748
749 \subsubsection{Examples}
750
751 Here is three examples for the different macros.
752 \begin{Exemple}
753 \drawPointsMeshinc[
754 color = blue!50,
755 print = points,
756 meshpoint = x,
757 scale=0.8cm,
758 ]{(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)}%
759 {% code before
760 beginfig(0);
761 }%
762 {% code after
763 label(btex Mesh $\mathbb{T}$ etex, (0,2u)) withcolor \luameshmpcolor;
764 endfig;
765 }
766 \buildMeshBWinc[%
767 bbox = show,
768 color = red,
769 colorBbox = blue!30,
770 print = points,
771 meshpoint = x,
772 scale=0.8cm
773 ]{(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)}%
774 {% code before
775 beginfig(0);
776 }
777 {% code after
778 drawdblarrow MeshPoints[3] -- MeshPoints[9] withpen pencircle scaled 1pt
779 withcolor (0.3,0.7,0.2);
780 endfig;
781 }
782 \meshAddPointBWinc[
783 meshpoint = \alpha,
784 newpoint = y,
785 colorBack=red!10,
786 colorNew = green!50!red,
787 colorCircle = blue,
788 colorBbox = black!20,
789 bbox = show,
790 scale=0.8cm,
791 step=badtriangles]
792 {(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)}%
793 {%code before
794 picture drawing;
795 drawing := image(
796 }{%code after
797 );
798 beginfig(0);
799 fill MeshPoints[7]--MeshPoints[8]--MeshPoints[9]--MeshPoints[10]--cycle
800 withcolor \mpcolor{blue!10};
801 draw drawing;
802 endfig;
803 }
804 \end{Exemple}
805 \begin{warning}
806 The variables \Verb+MeshPoints[]+ are not defined for the argument
807 corresponding to the code placed \textbf{before} the code generated by
808 \luamesh. Hence, to use such variables, we have to define a
809 \Verb+picture+ as shown in the third example above.
810 \end{warning}
811
812
813 \subsection{With TikZ}
814
815 If we have chosen \Verb+tikz+ as the drawing engine, the added code
816 will be written in \Verb+tikz+. In that case, the two arguments
817 \meta{code before} and \meta{code after} will be inserted as follows:
818 \begin{latexcode}
819 \noindent
820 \begin{tikzpicture}[x=<scale>,y=<scale>]
821 <<code before>>
822 <generated code>
823 <<code after>>
824 \end{tikzpicture}
825 \end{latexcode}
826
827 Because the engine is \Verb+tikz+ their is no issue with colors, the
828 \LaTeX{} colors (e.g.: \Verb+xcolor+) can be used directly.
829
830 \subsubsection{The Mesh Points}
831
832 The mesh points are defined here as \Verb+tikz+
833 \Verb+\coordinate+ and named as follows
834 \begin{latexcode}
835 \coordinate (MeshPoints1) at (...,...);
836 \coordinate (MeshPoints2) at (...,...);
837 \coordinate (MeshPoints3) at (...,...);
838 %etc.
839 \end{latexcode}
840
841 With the \Verb+\meshPolygon+ we have also the polygon points coordinates:
842 \begin{latexcode}
843 \coordinate (polygon1) at (...,...);
844 %etc.
845 \end{latexcode}
846
847 Once again these coordinates are not yet defined to be used in the
848 code given by \meta{code
849 before} argument.
850
851 \subsubsection{Examples}
852
853 \begin{Exemple}
854 \drawPointsMeshinc[
855 tikz,
856 color = blue!50,
857 print = points,
858 meshpoint = x,
859 scale=0.8cm,
860 ]{(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)}%
861 {% code before
862 }%
863 {% code after
864 \node[color = blue!50] at (0,2) {Mesh $\mathbb{T}$} ;
865 }
866 \buildMeshBWinc[%
867 tikz,
868 bbox = show,
869 color = red,
870 colorBbox = blue!30,
871 print = points,
872 meshpoint = x,
873 scale=0.8cm
874 ]{(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)}%
875 {% code before
876 }
877 {% code after
878 \draw[<->,thick, color=green] (MeshPoints3) -- (MeshPoints9);
879 }
880 \end{Exemple}
881
882 \section{Voronoï Diagrams}
883
884 Another interesting feature of b Delaunay triangulation is that its
885 \emph{dual} is the so-called Voronoï diagram. More precisely, for a
886 finite set of
887 points $\{p_{1},\ldots, p_{n}\}$ in the Euclidean plane, the Voronoï
888 cell $R_{k}$ corresponding to $p_{k}$ is the set of
889 all points in the Euclidean plane $\R^{2}$ whose distance to $p_{k}$ is less
890 than
891 or equal to its distance to any other $p_{k'}$.\bigskip
892
893
894 \commande|\buildVoronoiBW[«options»]{«list of points» or «file name»}|\medskip
895
896 This macro produce the Voronoï diagram of the given \meta{list of
897 points}. Once again, the
898 list of
899 points must be given in the following way :
900 \begin{center}
901 \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
902 \end{center}
903
904 \begin{Exemple}
905 \buildVoronoiBW{(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)}
906 \end{Exemple}
907
908 \subsection{The Options}\label{sec:voronoiOptions}
909
910
911 There are several options to customize the drawing.
912 \begin{optionsenum}
913 \item[mode = int (default) \textme{or} ext:] this option allows to
914 use either the previously described set of points in the argument, or
915 a file containing the points line by line (in 2 columns). Such a
916 file looks like :
917 \begin{verbatim}
918 x1 y1
919 x2 y2
920 x3 y3
921 ...
922 xn yn
923 \end{verbatim}
924 \item[bbox = none (default) \textme{or} show:] this option allows to draw the
925 added points to form a \emph{bounding box}\footnote{The bounding
926 box is defined by four points place at 15\% around the box
927 defined by $(x_{\min},y_{\min})$, $(x_{\min},y_{\max})$,
928 $(x_{\max},y_{\max})$, and $(x_{\min},y_{\max})$. It is used by
929 the algorithm and will be computed in any case.} and the corresponding
930 triangulation. By default, these points are removed at the end of
931 the algorithm.
932 \item[color = \meta{value} (default: black):] The color of the
933 drawing.
934 \item[colorBbox = \meta{value} (default: black):] The color of the
935 drawing for the elements (points and triangles) belonging to the
936 bounding box.
937 \item[colorVoronoi = \meta{value} (default: black):] The color of the
938 drawing for the elements (points and polygons) belonging to the
939 Voronoï diagram.
940 \item[print = none (default) \textme{or} points:] To label the
941 vertices in the
942 triangulation. Contrary to the previous macros, where
943 \Verb+print=none+, a \emph{dot} is produced at each vertex of the
944 set of points and at the circumcircle centers which are the nodes of
945 the Voronoï diagram.
946 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
947 label the vertices of the triangulation. This is included in the math
948 mode delimiters \Verb+$...$+. The bounding box points are labelled
949 with numbers 1 to 4 and with a star exponent.
950 \item[circumpoint = \meta{value} (default: P):] The letter(s) used to
951 label the vertices of the Voronoï diagram. This is included in the math
952 mode delimiters \Verb+$...$+.
953 \item[tikz (boolean, default:false):] By default, this boolean is set
954 to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
955 the picture. With this option, \Verb+tikz+ becomes the \textit{drawing
956 engine}.
957 \item[scale = \meta{value} (default: 1cm):] The scale option defines
958 the scale at which the picture is drawn (the same for both
959 axes). It must contain the unit of length (cm,
960 pt, etc.).
961 \item[delaunay = none (default) \textme{or} show:] This option
962 allows to draw the Delaunay triangulation under the Voronoï diagram.
963 \item[styleDelaunay = none (default) \textme{or} dashed:] This option
964 allows to draw the Delaunay triangulation in dashed lines.
965 \item[styleVoronoi = none (default) \textme{or} dashed:] This option
966 allows to draw the Voronoï edges in dashed lines.
967 \end{optionsenum}
968
969 \begin{Exemple}
970 \buildVoronoiBW[tikz,delaunay=show,styleDelaunay=dashed]
971 {(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)}
972 \end{Exemple}
973
974 \subsection{The \emph{inc} variant}
975
976 Once again, a variant of the macros is available allowing the user to
977 add code before and after the code produced by \luamesh. We refer to
978 section~\ref{sec:inc} because it works the same way.
979
980 Let us note that:
981 \begin{itemize}
982 \item with MetaPost, the circumcenters are defined using
983 \Verb+pair CircumPoints[];+ and so they are accessible.
984 \item With \Verb+tikz+, there are new coordinates defined as follows
985 \begin{latexcode}
986 \coordinate (CircumPoints1) at (...,...);
987 \coordinate (CircumPoints2) at (...,...);
988 \coordinate (CircumPoints3) at (...,...);
989 % etc.
990 \end{latexcode}
991 \end{itemize}
992
993 Finally, when the MetaPost drawing engine is used another color is
994 available (see~\ref{sec:mpcolor}): \Verb+\luameshmpcolorVoronoi+.
995
996 \section{With Gmsh}
997
998 Gmsh is an open source efficient software that produces meshes. The
999 exporting format is the \emph{MSH ASCII file format} and can be easily
1000 read by a Lua program. \luamesh provides the user with dedicated
1001 macros to read and draw meshes coming from a Gmsh exportation.\bigskip
1002
1003 \commande|\drawGmsh[«options»]{«file name»}|\medskip
1004
1005 This macro draws the triangulation produced by Gmsh and exported in the
1006 \Verb+msh+ format. The argument is the name of the file to be read
1007 (e.g.: \Verb+maillage.msh+).
1008
1009 \begin{Exemple}
1010 \drawGmsh{maillage.msh}
1011 \end{Exemple}
1012
1013 There are several options to customize the drawing.
1014 \begin{optionsenum}
1015 \item[color = \meta{value} (default: black):] The color of the
1016 drawing.
1017 \item[print = none (default) \textme{or} points:] To label the vertices of the
1018 triangulation. Contrary to some previous macros, when
1019 \Verb+print=none+ a \emph{dot} is produced at each vertex of the
1020 set of points and at the circumcircle centers (these are the nodes of
1021 the Voronoï diagram).
1022 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
1023 label the vertices of the triangulation. This is included in the math
1024 mode delimiters \Verb+$...$+. The bounding box points are labeled
1025 with numbers 1 to 4 and with a star exponent.
1026 \item[tikz (boolean, default:false):] By default, this boolean is set
1027 to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
1028 the picture. With this option, \Verb+tikz+ becomes the \textit{drawing
1029 engine}.
1030 \item[scale = \meta{value} (default: 1cm):] The scale option defines
1031 the scale at which the picture is drawn (the same for both
1032 axes). It must contain the unit of length (cm,
1033 pt, etc.).
1034 \end{optionsenum}
1035 Here is an example:
1036 \begin{Exemple}
1037 \drawGmsh[scale=2cm,print=points, color=blue!30]{maillage.msh}
1038 \end{Exemple}
1039
1040 \subsection{Gmsh and Voronoï Diagrams}
1041
1042 Because Gmsh generates Delaunay triangulations, we can plot the associated
1043 Voronoï diagram. This is done by the following macro:\bigskip
1044
1045 \commande|\gmshVoronoi[«options»]{«file name»}|\medskip
1046
1047 \begin{Exemple}
1048 \gmshVoronoi{maillage.msh}
1049 \end{Exemple}
1050
1051
1052 \subsection{The Options}\label{sec:voronoiOptions}
1053
1054
1055 There are several options to customize the drawing.
1056 \begin{optionsenum}
1057 \item[color = \meta{value} (default: black):] The color of the
1058 drawing.
1059 \item[colorVoronoi = \meta{value} (default: black):] The color of the
1060 drawing for the elements (points and polygons) belonging to the
1061 Voronoï diagram.
1062 \item[print = none (default) \textme{or} points:] To label the vertices of the
1063 triangulation. Contrary to some previous macros, when
1064 \Verb+print=none+, a \emph{dot} is produced at each vertex of the
1065 set of points and at the circumcircle centers (these are the nodes of
1066 the Voronoï diagram).
1067 \item[meshpoint = \meta{value} (default: P):] The letter(s) used to
1068 label the vertices of the triangulation. It is included in the math
1069 mode delimiters \Verb+$...$+. The bounding box points are labeled
1070 with numbers 1 to 4 and with a star exponent.
1071 \item[circumpoint = \meta{value} (default: P):] The letter(s) used to
1072 label the vertices of the Voronoï diagram. This is included in the math
1073 mode delimiters \Verb+$...$+.
1074 \item[tikz (boolean, default:false):] By default, this boolean is set
1075 to \Verb+false+, and MetaPost (with \Verb+luamplib+) is used to draw
1076 the picture. With this option, \Verb+tikz+ becomes the \textit{drawing
1077 engine}.
1078 \item[scale = \meta{value} (default: 1cm):] The scale option defines
1079 the scale at which the picture is drawn (the same for both
1080 axes). It must contain the unit of length (cm,
1081 pt, etc.).
1082 \item[delaunay = none (default) \textme{or} show] This option
1083 allows to draw the Delaunay triangulation overlapped with the
1084 Voronoï diagram.
1085 \item[styleDelaunay = none (default) \textme{or} dashed] This option
1086 allows to draw the Delaunay triangulation in dashed lines.
1087 \item[styleVoronoi = none (default) \textme{or} dashed] This option
1088 allows to draw the Voronoï edges in dashed lines.
1089 \end{optionsenum}
1090
1091 \begin{Exemple}
1092 \gmshVoronoi[tikz,scale=1.5cm, delaunay=show,styleVoronoi=dashed]{maillage.msh}
1093 \end{Exemple}
1094
1095
1096 \subsection{The \emph{inc} variants}
1097
1098 Once again, there exist \emph{inc} variant macros:\bigskip
1099
1100 \commande|\drawGmshinc[«options»]{«file name»}{«code before»}{«code after»}|\medskip
1101
1102 \commande|\gmshVoronoiinc[«options»]{«file name»}{«code before»}{«code after»}|\medskip
1103
1104 We refer to the previous sections for explanations.
1105
1106
1107
1108 \section{Gallery}
1109 \subsection{With Animate}
1110
1111 If you use \emph{Adobe Acrobat reader}, you can easily produce an
1112 animation of the Bowyer and Watson algorithm with the package
1113 \Verb+animate+.
1114
1115 For example, the following code (in a file name \Verb+animation.tex+):
1116 \begin{latexcode}
1117 \documentclass{article}
1118 %% lualatex compilation
1119 \usepackage[margin=2.5cm]{geometry}
1120 \usepackage{luamesh}
1121 \usepackage{fontspec}
1122 \usepackage{multido}
1123 \pagestyle{empty}
1124 \def\drawPath{draw (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle withcolor 0.99white;}
1125 \def\clipPath{clip currentpicture to (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle;}
1126 \begin{document}
1127 \drawPointsMeshinc[mode=ext, bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
1128 {%
1129 beginfig(0);
1130 \drawPath
1131 }%
1132 {%
1133 \clipPath
1134 endfig;
1135 }
1136 \newpage\buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{meshInit.txt}%
1137 {%
1138 beginfig(0);
1139 \drawPath
1140 }%
1141 {%
1142 \clipPath
1143 endfig;
1144 }
1145 \multido{\ii=5+1}{4}{%
1146 \newpage\meshAddPointBWinc[mode=ext,step=badtriangles,colorNew
1147 =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
1148 show,colorBbox = blue!20]{mesh.txt}{\ii}%
1149 {%
1150 beginfig(0);
1151 \drawPath
1152 }%
1153 {%
1154 \clipPath
1155 endfig;
1156 } \newpage
1157 \meshAddPointBWinc[mode=ext,step=cavity,colorNew
1158 =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
1159 show,colorBbox = blue!20]{mesh.txt}{\ii}%
1160 {%
1161 beginfig(0);
1162 \drawPath
1163 }%
1164 {%
1165 \clipPath
1166 endfig;
1167 } \newpage
1168 \meshAddPointBWinc[mode=ext,step=newtriangles,colorNew
1169 =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
1170 show,colorBbox = blue!20]{mesh.txt}{\ii}%
1171 {%
1172 beginfig(0);
1173 \drawPath
1174 }%
1175 {%
1176 \clipPath
1177 endfig;
1178 }
1179 }
1180 \newpage
1181 \buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
1182 {%
1183 beginfig(0);
1184 \drawPath
1185 }%
1186 {%
1187 \clipPath
1188 endfig;
1189 }
1190 \newpage
1191 \buildMeshBWinc[mode=ext,print=points]{mesh.txt}%
1192 {%
1193 beginfig(0);
1194 \drawPath
1195 }%
1196 {%
1197 \clipPath
1198 endfig;
1199 }
1200 \end{document}
1201 \end{latexcode}
1202 produces a PDF with multiple pages. Using the \Verb+pdfcrop+ program,
1203 we crop the pages to the material, and then we can animate the PDF
1204 using the \Verb+animate+ package.
1205
1206 %\begin{Exemple}
1207 %\animategraphics[controls]{1}{animation-crop}{}{}
1208 %\end{Exemple}
1209
1210 \input{dum.bbl}
1211
1212 \end{document}
1213
1214
1215
1216 %%% Local Variables:
1217 %%% flyspell-mode: 1
1218 %%% ispell-local-dictionary: "american"
1219 %%% End:

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.