texlive[43767] Master: luamesh (12apr17)
commits+karl at tug.org
commits+karl at tug.org
Wed Apr 12 23:12:32 CEST 2017
Revision: 43767
http://tug.org/svn/texlive?view=revision&revision=43767
Author: karl
Date: 2017-04-12 23:12:32 +0200 (Wed, 12 Apr 2017)
Log Message:
-----------
luamesh (12apr17)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/libexec/ctan2tds
trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/lualatex/luamesh/
trunk/Master/texmf-dist/doc/lualatex/luamesh/README
trunk/Master/texmf-dist/doc/lualatex/luamesh/animation-crop.pdf
trunk/Master/texmf-dist/doc/lualatex/luamesh/biblio.bib
trunk/Master/texmf-dist/doc/lualatex/luamesh/dum.tex
trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.mp
trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.pdf
trunk/Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls
trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing
trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf
trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex
trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-title.pdf
trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.geo
trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.msh
trunk/Master/texmf-dist/doc/lualatex/luamesh/mesh.txt
trunk/Master/texmf-dist/doc/lualatex/luamesh/meshgarde.txt
trunk/Master/texmf-dist/scripts/luamesh/
trunk/Master/texmf-dist/scripts/luamesh/luamesh.lua
trunk/Master/texmf-dist/tex/lualatex/luamesh/
trunk/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty
trunk/Master/tlpkg/tlpsrc/luamesh.tlpsrc
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/README
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/README (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/README 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,45 @@
+-*- coding: utf-8 -*-
+Bclogo package by Maxime Chupin
+Version 0.5 dated 2017/02/09
+
+The LuaLaTeX package luamesh allows to compute and draw 2D Delaunay triangulation.
+The algorithm is written with lua, and depending on the choice of the “engine”,
+the drawing is done by MetaPost (with luamplib) or by tikz.
+The Delaunay triangulation algorithm is the Bowyer and Watson algorithm.
+Several macros are provided to draw the global mesh, the set of points, or
+a particular step of the algorithm.
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+FILES :
+===== documentation =====
+README
+animation-crop.pdf
+biblio.bib
+dum.bbl
+dum.tex
+fond.mp
+fond.pdf
+lltxdoc.cls
+luamesh-doc.listing
+luamesh-doc.pdf
+luamesh-doc.tex
+luamesh-title.pdf
+maillage.geo
+maillage.msh
+meshgarde.txt
+
+===== Lua Script File =====
+luamesh.lua
+
+===== Files for LuaLaTeX =====
+luamesh.sty
+==================
+
+The archive luamesh-v0-5.zip contains all the files to insert into your texmf.
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/animation-crop.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/lualatex/luamesh/animation-crop.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/animation-crop.pdf 2017-04-12 21:08:50 UTC (rev 43766)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/animation-crop.pdf 2017-04-12 21:12:32 UTC (rev 43767)
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/animation-crop.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/biblio.bib
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/biblio.bib (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/biblio.bib 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,92 @@
+% This file was created with JabRef 2.10.
+% Encoding: UTF-8
+
+
+ at Article{Bowyer,
+ Title = {Computing {D}irichlet tessellations},
+ Author = {Bowyer, A.},
+ Journal = {Comput. J.},
+ Year = {1981},
+ Number = {2},
+ Pages = {162--166},
+ Volume = {24},
+
+ Coden = {CMPJA6},
+ Doi = {10.1093/comjnl/24.2.162},
+ Fjournal = {The Computer Journal},
+ ISSN = {0010-4620},
+ Mrclass = {52-04 (52A25)},
+ Mrnumber = {619576},
+ Url = {http://dx.doi.org/10.1093/comjnl/24.2.162}
+}
+
+ at Book{Frey,
+ Title = {Mesh generation},
+ Author = {Frey, Pascal Jean and George, Paul-Louis},
+ Publisher = {ISTE, London; John Wiley \& Sons, Inc., Hoboken, NJ},
+ Year = {2008},
+ Edition = {Second},
+ Note = {Application to finite elements},
+
+ Doi = {10.1002/9780470611166},
+ ISBN = {978-1-84821-029-5},
+ Mrclass = {65N50 (65-02 65N30)},
+ Mrnumber = {2398720},
+ Pages = {848},
+ Url = {http://dx.doi.org/10.1002/9780470611166}
+}
+
+ at Manual{luamplib,
+ Title = {luamplib – Use LuaTeX's built-in METAPOST interpreter},
+ Author = {Hagen, Hans and Hoekwater, Taco and Roux, Élie and Pégourié-Gonnard, Manuel and Gesang, Philipp and Kim, Dohyun},
+ Note = {v. 2.11.3},
+ Year = {2016},
+
+ Owner = {chupin},
+ Timestamp = {2016.11.28}
+}
+
+ at Manual{animate,
+ Title = {The animate Package},
+ Author = {Grahn, Alexander},
+ Note = {},
+ Year = {2016},
+}
+
+ at Manual{tikz,
+ Title = {pgf – Create PostScript and PDF graphics in TeX},
+ Author = {Tantau, Till and Feuersänger, Christian},
+ Note = {v. 3.0.1a},
+ Year = {2015},
+
+ Owner = {chupin},
+ Timestamp = {2016.11.28}
+}
+ at Manual{gmsh,
+ Title = {Gmsh Reference Manual},
+ Author = {Geuzaine, Christophe and Remacle, Jean-Francois Tantau},
+ Note = {v. 2.14},
+ Year = {2016},
+
+ Owner = {chupin},
+ Timestamp = {2016.11.28}
+}
+
+ at Article{Watson,
+ Title = {Computing the {$n$}-dimensional {D}elaunay tessellation with
+ application to {V}orono\u\i\ polytopes},
+ Author = {Watson, D. F.},
+ Journal = {Comput. J.},
+ Year = {1981},
+ Number = {2},
+ Pages = {167--172},
+ Volume = {24},
+
+ Coden = {CMPJA6},
+ Doi = {10.1093/comjnl/24.2.167},
+ Fjournal = {The Computer Journal},
+ ISSN = {0010-4620},
+ Mrclass = {52-04 (52A25)},
+ Mrnumber = {619577},
+ Url = {http://dx.doi.org/10.1093/comjnl/24.2.167}
+}
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/biblio.bib
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/dum.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/dum.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/dum.tex 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,6 @@
+\documentclass{article}
+\begin{document}
+\nocite{*}
+\bibliography{biblio}
+\bibliographystyle{plain}
+\end{document}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/dum.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.mp
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.mp (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.mp 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,21 @@
+input svgnames;
+
+l = 596;
+h = 842;
+
+pair A, B, C, D;
+
+A = (0,0);
+B = (l,0);
+C = (l,h);
+D = (0,h);
+
+beginfig(1);
+
+ fill (A--B--D--cycle) withcolor Moccasin;
+ fill (A--C--D--cycle) withcolor Gainsboro;
+
+
+endfig;
+
+end
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.mp
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.pdf 2017-04-12 21:08:50 UTC (rev 43766)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.pdf 2017-04-12 21:12:32 UTC (rev 43767)
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/fond.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,105 @@
+% private class for lualatex-doc
+% see lualatex-doc.tex for copying conditions
+% Manuel Pégourié-Gonnard
+
+\ProvidesClass{lltxdoc}
+
+\LoadClass[a4paper]{scrartcl}
+\RequirePackage{luamesh}
+\RequirePackage{fontspec}
+\RequirePackage{metalogo, xspace, ifmtarg, xargs, fancyvrb}
+\RequirePackage[french,english]{babel}
+\RequirePackage[colorlinks=true]{hyperref}
+%\RequirePackage{bookmark}
+
+\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
+% \setmainfont{Linux Libertine O}
+%\setmainfont{Slabo 27px}
+\usepackage{unicode-math}
+\setmainfont{Libertinus Serif}
+\setmathfont{Libertinus Math}
+\setsansfont{Kurier}
+\setmonofont{Monaco}
+
+\newcommand*\simplelogo [1] {%
+ \ifcsname #1\endcsname \else \badlogocommand \fi
+ \lowercase{\expandafter\simple at logo\expandafter{%
+ \csname #1\expandafter\endcsname\expandafter}}\expandafter{%
+ \csname #1\endcsname}{#1}}
+\newcommand*\simple at logo [3] {%
+ \newcommand #1 {#2\xspace}%
+ \pdfstringdefDisableCommands{\def#1{#3\space}}}
+
+\providecommand \ConTeXt {Con\TeX{}t}
+\providecommand \pdfTeX {pdf\TeX}
+\providecommand \TeXLive {\TeX\thinspace Live}
+\providecommand \MiKTeX {MiK\TeX}
+
+\simplelogo {TeX}
+\simplelogo {LaTeX}
+\simplelogo {LuaTeX}
+\simplelogo {LuaLaTeX}
+\simplelogo {XeTeX}
+\simplelogo {XeLaTeX}
+\simplelogo {ConTeXt}
+\simplelogo {pdfTeX}
+\simplelogo {MiKTeX}
+\simplelogo {TeXLive}
+
+\colorlet{code}{blue!80!black}
+\fvset{formatcom=\color{code}}
+\DefineShortVerb|
+\catcode`\ 10 % non-breakable space
+
+\newcommand*\email [1] {<\href{mailto:#1}{#1}>}
+\newcommand*\ctan [1]
+{\href{http://mirror.ctan.org/#1}{\nolinkurl{#1}}}
+\newcommand \file {\nolinkurl}
+\newcommand*\note [1] {\noindent\textsf{\bfseries #1.}\quad\ignorespaces}
+\newcommand \cmd {\texttt}
+\newcommand \code [1] {\texorpdfstring {\texttt{\color{code}#1}} {#1}}
+\newcommand*\cs [1] {\code{\textbackslash #1}}
+
+\newcommandx*\para [2][2] {%
+ \@ifmtarg{#2}{\para@{#1}{#1}}{\para@{#1}{#2}}}
+\newcommand \para@ [2] {%
+ \par \medskip
+ \hypertarget{para.#2}{}%
+ \belowpdfbookmark{#1}{para.#2}%
+ \noindent
+ \label{para.#2}%
+ \makebox [0pt][r] {%
+ \textsf{\bfseries #1\quad}}%
+ \ignorespaces
+}
+\newcommandx*\pararef [3][1, 3] {%
+ \@ifmtarg{#3}{\para at ref{#1}{#2}{#2}}{\para at ref{#1}{#2}{#3}}}
+\newcommand \para at ref [3] {%
+ \hyperlink{para.#3}{#1{#2}}}
+\newcommand*\parapageref [1] {%
+ \autopagref{para.#1}}
+
+\newcommand \pf {\textsf}
+\newcommand \pk {\pararef[\pf]}
+
+\newcommandx*\pkdesc [6][6] {%
+ \para {#1}
+ \pkditem {Engines} {#3}
+ \pkditem {Formats} {#4}
+ \pkditem {Authors} [\\]{#2}
+ \pkditem {CTAN location} [\\]{#5}[\ctan]
+ \pkditem {Development url} [\\]{#6}[\url]
+ \newline
+}
+\newcommandx*\pkditem [4][2,4] {\@ifnotmtarg{#3}{%
+ #2\textsf{\bfseries #1:} #4{#3}.%
+ }}
+
+
+\newenvironment{myquote}{%
+ \list{}{\leftmargin0pt \rightmargin1em}%
+\item\relax
+ \small
+}{%
+ \endlist
+}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/lltxdoc.cls
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.listing 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,84 @@
+ \documentclass{article}
+ %% lualatex compilation
+ \usepackage[margin=2.5cm]{geometry}
+ \usepackage{luamesh}
+ \usepackage{fontspec}
+ \usepackage{multido}
+ \pagestyle{empty}
+ \def\drawPath{draw (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle withcolor 0.99white;}
+ \def\clipPath{clip currentpicture to (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle;}
+ \begin{document}
+ \drawPointsMeshinc[mode=ext, bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ \newpage\buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{meshInit.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ \multido{\ii=5+1}{4}{%
+ \newpage\meshAddPointBWinc[mode=ext,step=badtriangles,colorNew
+ =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
+ show,colorBbox = blue!20]{mesh.txt}{\ii}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ } \newpage
+ \meshAddPointBWinc[mode=ext,step=cavity,colorNew
+ =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
+ show,colorBbox = blue!20]{mesh.txt}{\ii}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ } \newpage
+ \meshAddPointBWinc[mode=ext,step=newtriangles,colorNew
+ =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
+ show,colorBbox = blue!20]{mesh.txt}{\ii}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ }
+ \newpage
+ \buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ \newpage
+ \buildMeshBWinc[mode=ext,print=points]{mesh.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+\end{document}
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf 2017-04-12 21:08:50 UTC (rev 43766)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf 2017-04-12 21:12:32 UTC (rev 43767)
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,1219 @@
+% luamesh: compute and draw meshes with lua, luamplib and tikz
+%
+% Originally written by Maxime Chupin <mc at melusine.eu.org>,
+% 2010.
+%
+% Distributed under the terms of the GNU free documentation licence:
+% http://www.gnu.org/licenses/fdl.html
+% without any invariant section or cover text.
+
+\documentclass{lltxdoc}
+\usepackage{tcolorbox}
+\usepackage{enumitem}
+\usepackage[tikz]{bclogo}
+\usepackage{wrapfig}
+\usepackage{animate}
+
+\title{\Verb+luamesh+: compute and draw meshes with \lualatex}
+\author{Maxime Chupin \email{mc at melusine.eu.org}}
+\date{\today}
+
+
+\definecolor{darkred}{rgb}{0.8,0.1,0.1}
+
+
+\newcommand*\commande{\noindent\hspace{-30pt}%
+ \SaveVerb[aftersave={%
+ \UseVerb{Vitem}
+ }%
+ ]{Vitem}}
+
+\newcommand*\textme[1]{\textcolor{black}{\rmfamily\textit{#1}}}
+\newcommand*\meta[1]{% % meta
+ \textme{\ensuremath{\langle}#1\ensuremath{\rangle}}}
+\newcommand*\optstar{% % optional star
+ \meta{\ensuremath{*}}\xspace}
+\DefineShortVerb{\|}
+\newcommand\R{\mathbf{R}}
+\setlength{\fboxsep}{2pt}
+\fvset{%
+ codes={\catcode`\«\active \catcode`\×\active },
+ defineactive={\makefancyog\makefancytimes},
+ formatcom=\color{darkred},
+ frame=single
+}
+% rendre «...» équivalent à \meta{...}
+{\catcode`\«\active
+ \newcommandx\makefancyog[0][addprefix=\global]{%
+ \def«##1»{\meta{##1}}}}
+% rendre × équivalent à \optstar
+{\catcode`\×\active
+ \newcommandx\makefancytimes[0][addprefix=\global]{%
+ \def×{\optstar{}}}}
+
+
+\tcbuselibrary{listings,breakable}
+
+\definecolor{vert}{rgb}{0.1,0.4,0.1}
+\definecolor{bleu}{rgb}{0.1,0.1,0.4}
+\lstset{
+ numberstyle=\footnotesize\color{vert},
+ keywordstyle=\ttfamily\bfseries\color{blue},
+ basicstyle=\ttfamily\footnotesize,
+ commentstyle=\itshape\color{vert},
+ stringstyle=\ttfamily,
+ showstringspaces=false,
+ language=[LaTeX]TeX,
+ breaklines=true,
+ breakindent=30pt,
+ defaultdialect=[LaTeX]TeX,
+ morekeywords={buildMeshBW,buildMeshBWinc,drawPointsMesh,buildVoronoiBW,buildVoronoiBWinc,
+ drawPointsMeshinc, meshAddPointBW,
+ meshAddPointBWinc,drawGmsh,drawGmshinc,gmshVoronoi,gmshVoronoiinc}% frame=tb
+}
+
+\lstdefinelanguage{lua}
+{morekeywords={for,end,function,do,if,else,elseif,then,
+ tex.print,tex.sprint,io.read,io.open,string.find,string.explode,require},
+ morecomment=[l]{--},
+ morecomment=[s]{--[[}{]]},
+ morestring=[b]''
+}
+
+\newtcblisting{Exemple}{%
+ arc=0pt,outer arc=0pt,
+ colback=red!2!white,
+ colframe=red!75!black,
+ breakable,
+ boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle =
+ 3pt, toptitle=3pt,
+ boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break =
+ 0pt, bottomrule at break = 0pt,
+ listing options={breaklines},
+}
+
+\newtcblisting{commandshell}{colback=black,colupper=white,colframe=black,
+ arc=0pt,
+ listing only,boxsep=0pt,listing
+ options={style=tcblatex,language=sh},
+ every listing line={\textcolor{red}{\small\ttfamily\bfseries user \$> }}}
+
+\newtcblisting{latexcode}{
+ arc=0pt,outer arc=0pt,
+ colback=red!2!white,
+ colframe=red!75!black,
+ breakable,
+ boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle =
+ 3pt, toptitle=3pt,
+ boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break =
+ 0pt, bottomrule at break = 0pt,
+ listing only,boxsep=0pt,listing
+ options={breaklines}
+}
+
+
+\newcommand\luamesh{\Verb+luamesh+\xspace}
+
+\newenvironment{optionsenum}[1][]
+{\begin{description}[font=\color{darkred}\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}
+
+\lstset{moredelim=*[s][\color{red}\rmfamily\itshape]{<}{>}}
+\lstset{moredelim=*[s][\color{blue}\rmfamily\itshape]{<<}{>>}}
+\usepackage[colorlinks=true]{hyperref}
+\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-title}\\
+{\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.5, 2017, February, 9th \\
+ \url{http://melusine.eu.org/syracuse/G/delaunay/}
+\end{center}
+%% == Page de garde ====================================================
+\newpage
+
+\maketitle
+
+\begin{abstract}
+ The package \Verb|luamesh| allows to compute and draw 2D Delaunay
+ triangulation. The algorithm is written with lua, and depending on the
+ choice of the ``engine'', the drawing is done by MetaPost (with
+ \Verb|luamplib|) or by \Verb|tikz|.
+
+ The Delaunay triangulation algorithm is the Bowyer and Watson
+ algorithm. Several macros are provided to draw the global mesh, the
+ set of points, or a particular step of the algorithm.
+\end{abstract}
+
+I would like to thank Jean-Michel Sarlat, who hosts the development
+with a git project on the \Verb+melusine+ machine:
+\begin{center}
+ \url{https://melusine.eu.org/syracuse/G/delaunay/}
+\end{center}
+I would also like to thank the first user, an intensive
+\emph{test} user, and a very kind English corrector: Nicole Spillane.
+
+\tableofcontents
+
+\section{Installation}
+
+
+Of course, you can just put the two files \Verb+luamesh.lua+ and
+\Verb+luamesh.sty+ in the working directory but this is not
+recommended.
+
+
+\subsection{With \TeX live and Linux or Mac OSX}
+
+To install \luamesh with \TeX live, you have to create the local
+\Verb+texmf+ directory in your \Verb+home+.
+
+\begin{commandshell}
+mkdir ~/texmf
+\end{commandshell}
+
+Then place the files in the correct directories. The
+\Verb+luamesh.sty+ file must be in directory:
+\begin{center}
+ \Verb+~/texmf/tex/latex/luamesh/+
+\end{center}
+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}
+
+Once you have done this, \luamesh can be included in your document
+with
+\begin{latexcode}
+\usepackage{luamesh}
+\end{latexcode}
+
+\subsection{With Mik\TeX{} and Windows}
+
+As these two systems are unknown to the contributor, we refer to the
+documentation for integrating local additions to Mik\TeX:
+\begin{center}
+ \url{http://docs.miktex.org/manual/localadditions.html}
+\end{center}
+
+
+\subsection{A \lualatex package}
+
+If you want to use this package, you must compile your document with
+\Verb+lualatex+:
+
+\begin{commandshell}
+ lualatex mylatexfile.tex
+\end{commandshell}
+
+
+\subsection{Dependencies}
+
+This package is built upon two main existing packages that one used to
+draw the
+triangulations :
+\begin{enumerate}
+\item \Verb+luamplib+ to use MetaPost via the \luatex library
+ \Verb+mplib+;
+\item \Verb+tikz+.
+\end{enumerate}
+We will see how to choose between these two \emph{drawing engines}.
+Moreover, the following packages are necessary:
+\begin{enumerate}
+\item \Verb+xkeyval+ to manage the optional arguments;
+\item \Verb+xcolor+ to use colors (required by \Verb+luamplib+);
+\item \Verb+ifthen+ to help programming with \TeX.
+\end{enumerate}
+
+
+\section{The Basic Macros}
+
+This package provides macros to draw two
+dimensional triangulations (or meshes).
+
+\subsection{Draw a Complete Mesh}\label{sec:buildMesh}
+
+\commande|\buildMeshBW[«options»]{«list of points» or «file name»}|\medskip
+
+This macro produces the Delaunay triangulation (using the Bowyer and
+Watson algorithm) of the given \meta{list of points}. The list of
+points must be given in the following way :
+\begin{center}
+ \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
+\end{center}
+
+\begin{Exemple}
+ \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)}
+\end{Exemple}
+
+\subsubsection{The Options}
+
+There are several options 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 in 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[bbox = none (default) \textme{or} show:] this option allows to draw the
+ points added to form the \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})$. It is used by
+ the algorithm and will be computed in any case.} and the
+ triangles attached. 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) \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
+ with numbers 1 to 4 and with a star exponent.
+\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+ becomes 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
+ axes). 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 very relevant here, although it is useful to
+understand how the drawing is produced. However, the engine will be
+relevant to
+the so called \emph{inc} macros (section~\ref{sec:inc}) for adding
+code before and after the one generated by
+\luamesh.
+\end{warning}
+
+\subsection{Draw the Set of Points}
+
+\commande|\drawPointsMesh[«options»]{«list of points» or «file name»}|\medskip
+
+With the \Verb+\drawPointsMesh+, we plot the set of (user chosen) points from
+which the Bowyer and Watson algorithm computes the triangulation.
+
+The use of this macro is quite similar to
+\Verb+\buildMeshBW+. Here is an example of the basic uses.
+\begin{Exemple}
+ \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)}
+\end{Exemple}
+
+
+\subsubsection{The Options}
+
+There are several options (exactly the same as for the
+\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[bbox = none (default) \textme{or} show:] this option allows to draw the
+ points added to form the \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})$. It is used by
+ the algorithm and will be computed in any case.} and the
+ triangles attached. By default, these triangles are removed at the end of
+ the algorithm. \emph{Here, because we plot only the vertices of the
+ mesh, there are no triangles, only dots.}
+\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) \textme{or} points:] To label the vertices of the
+ triangulation. This also adds a \emph{dot} at each vertex. With no
+ label, the dot remains.
+\item[meshpoint = \meta{value} (default: P):] The letter(s) used to
+ label the vertices of the triangulation. This is included in the math
+ mode delimiters \Verb+$...$+. The bounding box points are labeled
+ with numbers 1 to 4 and with a star exponent.
+\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+ becomes 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
+ axes). It must contain the unit of length (cm,
+ pt, etc.).
+\end{optionsenum}
+With the same external mesh point file presented in
+section~\ref{sec:buildMesh}, we illustrate the different options.
+
+\begin{Exemple}
+ \drawPointsMesh[%
+ tikz,
+ mode = ext,
+ bbox = show,
+ color = blue,
+ colorBbox = red,
+ print = points,
+ meshpoint = y,
+ scale = 1.3cm,
+ ]{mesh.txt}
+\end{Exemple}
+
+
+\subsection{Draw a Step of the Bowyer and Watson Algorithm}
+
+\commande|\meshAddPointBW[«options»]{«list of points» or «file name»}{«point» or «number of line»}|\medskip
+
+This command allows to plot the steps within the addition of a
+point in a Delaunay triangulation by the Bowyer and Watson
+algorithm.
+
+This macro produces the Delaunay triangulation (using the Bowyer and
+Watson algorithm) of the given \meta{list of points} and shows a step
+of the algorithm when the \meta{point} is added. The list of
+points must be given in the following way:
+\begin{center}
+ \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
+\end{center}
+and the point is of the form \verb+(x,y)+. The \meta{file name}
+and \meta{number of line} will be explained in the option
+description.
+
+One can use the macro as follows:
+\begin{Exemple}
+ \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)}
+ \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)}
+ \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)}
+\end{Exemple}
+The default value for \Verb+step+ is
+\Verb+badtriangles+. Consequently, the first
+line is equivalent to
+\begin{latexcode}
+\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)}
+\end{latexcode}
+
+\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}
+For the second argument of the macro, if we are in
+\Verb+mode = ext+, the argument must be the \emph{line number} of the file
+corresponding to the point we want to add. The algorithm will stop at the
+previous line to build the initial triangulation and proceed to add
+the point corresponding to the line requested. The subsequent lines in
+the file are
+ignored.
+\item[bbox = none (default) \textme{or} show:] this option allows to draw the
+ added points that form the \emph{bounding box} and the triangles
+ attached. Although they are always computed, 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[colorNew = \meta{value} (default: red):] The color of the
+ drawing of the ``new'' elements which are the point to add, the
+ polygon delimiting the cavity, and the new triangles.
+\item[colorBack = \meta{value} (default: black!20):] The color for the
+ filling of the region concerned by the addition of the new point.
+\item[colorCircle = \meta{value} (default: green):] The color for
+ the circumcircle of the triangles containing the point to add.
+\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
+ with numbers 1 to 4 and with a star exponent.
+\item[step = badtriangles (default) \textme{or} cavity \textme{or}
+ newtriangles:] To choose the step we want to draw, corresponding to
+ the steps of the Bowyer and Watson algorithm.
+\item[newpoint = \meta{value} (default: P):] The letter(s) used to
+ label the new point of the triangulation. It is include in the math
+ mode delimiters \Verb+$...$+.
+\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. First, recall that
+the external file \Verb+mesh.txt+ is:
+\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}
+We draw the addition of the 6th point. The 7th line will be ignored.
+\begin{Exemple}
+ \meshAddPointBW[
+ tikz,
+ mode = ext,
+ color = blue!70,
+ meshpoint = \alpha,
+ newpoint = y,
+ colorBack=red!10,
+ colorNew = green!50!red,
+ colorCircle = blue,
+ colorBbox = black!20,
+ bbox = show,
+ scale=1.4cm,
+ step=badtriangles]
+ {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 = polygon \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.).
+\item[gridpoints = rect (default) \textme{or} perturb:] This option
+ allows to specify the mode of generation of the grid points. The
+ value \Verb+rect+ produces a simple rectangular grid, and the value
+ \Verb+pertub+ randomly perturbs the rectangular grid.
+\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,
+ gridpoints=perturb]
+ {(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
+macros, with the suffix \Verb+inc+ that allow the user to add code
+(MetaPost or \Verb+tikz+, depending of the drawing engine) before and
+after the code generated by \luamesh.
+
+The three macros are:\medskip
+
+
+\commande|\buildMeshBWinc[«options»]{«list of points» or «file name»}{«code before»}{«code after»}|\medskip
+
+\commande|\drawPointsMeshinc[«options»]{«list of points» or «file name»}{«code before»}{«code after»}|\medskip
+
+\commande|\meshAddPointBWinc[«options»]{«list of points» or «file name»}%|
+
+\commande| {«point» or «number of line»}{«code before»}{«code after»}|\medskip
+
+\subsection{With MetaPost}
+
+We consider the case where the drawing engine is MetaPost (through the
+\Verb+luamplib+ package).
+
+The feature is described for the \Verb+\buildMeshBWinc+ but the mechanism
+and possibilities are exactly the same for all three macros.
+
+When we use the MetaPost drawing engine, the macros previously
+described produce a code of the form
+\begin{latexcode}
+\begin{luamplib}
+ u:=<scale>;
+ beginfig(0);
+ <code for the drawing>
+ endfig;
+\end{luamplib}
+\end{latexcode}
+
+Then, the arguments \meta{code before} and \meta{code after} are
+inserted as follows:
+\begin{latexcode}
+\begin{luamplib}
+ u:=<scale>;
+ <<code before>>
+ <code for the drawing>
+ <<code after>>
+\end{luamplib}
+\end{latexcode}
+\begin{warning}
+With the \emph{inc} macros, the user has to add the \Verb+beginfig();+
+and \Verb+endfig;+ commands to produce a picture. Indeed, this allows
+to use the \Verb+\everymplib+ command from the \Verb+\luamplib+ package.
+\end{warning}
+
+\subsubsection{The \LaTeX{} Colors Inside the MetaPost Code}\label{sec:mpcolor}
+
+The configurable colors
+of the \LaTeX{} macro are accessible inside the MetaPost code. For
+\Verb+\buildMeshBWinc+ and \Verb+\drawPointsMeshinc+,
+\Verb+\luameshmpcolor+,
+and \Verb+\luameshmpcolorBbox+ have been defined.
+For the macro \Verb+\meshAddPointBWinc+ three additional
+colors are present: \Verb+\luameshmpcolorBack+,
+\Verb+\luameshmpcolorNew+, and
+\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.
+
+\subsubsection{The Mesh Points}
+
+At the beginning of the automatically generated code, a list of
+MetaPost \Verb+pair+s are defined corresponding to all the vertices in
+the mesh (when the option \Verb+bbox=show+, the last 4 points are the
+\emph{bounding box points}). The points are available with the
+\Verb+MeshPoints[]+ table of variables. The \Verb+pair+s ($\R^{2}$ points)
+\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.
+\begin{Exemple}
+\drawPointsMeshinc[
+color = blue!50,
+print = points,
+meshpoint = x,
+scale=0.8cm,
+]{(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)}%
+{% code before
+ beginfig(0);
+}%
+{% code after
+ label(btex Mesh $\mathbb{T}$ etex, (0,2u)) withcolor \luameshmpcolor;
+ endfig;
+}
+\buildMeshBWinc[%
+bbox = show,
+color = red,
+colorBbox = blue!30,
+print = points,
+meshpoint = x,
+scale=0.8cm
+]{(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)}%
+{% code before
+ beginfig(0);
+}
+{% code after
+ drawdblarrow MeshPoints[3] -- MeshPoints[9] withpen pencircle scaled 1pt
+ withcolor (0.3,0.7,0.2);
+ endfig;
+}
+\meshAddPointBWinc[
+meshpoint = \alpha,
+newpoint = y,
+colorBack=red!10,
+colorNew = green!50!red,
+colorCircle = blue,
+colorBbox = black!20,
+bbox = show,
+scale=0.8cm,
+step=badtriangles]
+{(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)}%
+{%code before
+ picture drawing;
+ drawing := image(
+}{%code after
+ );
+ beginfig(0);
+ fill MeshPoints[7]--MeshPoints[8]--MeshPoints[9]--MeshPoints[10]--cycle
+ withcolor \mpcolor{blue!10};
+ draw drawing;
+ endfig;
+}
+\end{Exemple}
+\begin{warning}
+ The variables \Verb+MeshPoints[]+ are not defined for the argument
+ corresponding to the code placed \textbf{before} the code generated by
+ \luamesh. Hence, to use such variables, we have to define a
+ \Verb+picture+ as shown in the third example above.
+\end{warning}
+
+
+\subsection{With TikZ}
+
+If we have chosen \Verb+tikz+ as the drawing engine, the added code
+will be written in \Verb+tikz+. In that case, the two arguments
+\meta{code before} and \meta{code after} will be inserted as follows:
+\begin{latexcode}
+\noindent
+\begin{tikzpicture}[x=<scale>,y=<scale>]
+ <<code before>>
+ <generated code>
+ <<code after>>
+\end{tikzpicture}
+\end{latexcode}
+
+Because the engine is \Verb+tikz+ their is no issue with colors, the
+\LaTeX{} colors (e.g.: \Verb+xcolor+) can be used directly.
+
+\subsubsection{The Mesh Points}
+
+The mesh points are defined here as \Verb+tikz+
+\Verb+\coordinate+ and named as follows
+\begin{latexcode}
+\coordinate (MeshPoints1) at (...,...);
+\coordinate (MeshPoints2) at (...,...);
+\coordinate (MeshPoints3) at (...,...);
+%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.
+
+\subsubsection{Examples}
+
+\begin{Exemple}
+ \drawPointsMeshinc[
+ tikz,
+ color = blue!50,
+ print = points,
+ meshpoint = x,
+ scale=0.8cm,
+ ]{(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)}%
+ {% code before
+ }%
+ {% code after
+ \node[color = blue!50] at (0,2) {Mesh $\mathbb{T}$} ;
+ }
+ \buildMeshBWinc[%
+ tikz,
+ bbox = show,
+ color = red,
+ colorBbox = blue!30,
+ print = points,
+ meshpoint = x,
+ scale=0.8cm
+ ]{(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)}%
+ {% code before
+ }
+ {% code after
+ \draw[<->,thick, color=green] (MeshPoints3) -- (MeshPoints9);
+ }
+\end{Exemple}
+
+\section{Voronoï Diagrams}
+
+Another interesting feature of b Delaunay triangulation is that its
+\emph{dual} is the so-called Voronoï diagram. More precisely, for a
+finite set of
+points $\{p_{1},\ldots, p_{n}\}$ in the Euclidean plane, the Voronoï
+cell $R_{k}$ corresponding to $p_{k}$ is the set of
+all points in the Euclidean plane $\R^{2}$ whose distance to $p_{k}$ is less
+than
+or equal to its distance to any other $p_{k'}$.\bigskip
+
+
+\commande|\buildVoronoiBW[«options»]{«list of points» or «file name»}|\medskip
+
+This macro produce the Voronoï diagram of the given \meta{list of
+ points}. Once again, the
+list of
+points must be given in the following way :
+\begin{center}
+ \verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
+\end{center}
+
+\begin{Exemple}
+ \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)}
+\end{Exemple}
+
+\subsection{The Options}\label{sec:voronoiOptions}
+
+
+There are several options 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 in 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[bbox = none (default) \textme{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})$. It is used by
+ the algorithm and will be computed in any case.} and the corresponding
+ triangulation. By default, these points 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[colorVoronoi = \meta{value} (default: black):] The color of the
+ drawing for the elements (points and polygons) belonging to the
+ Voronoï diagram.
+\item[print = none (default) \textme{or} points:] To label the
+ vertices in the
+ triangulation. Contrary to the previous macros, where
+ \Verb+print=none+, a \emph{dot} is produced at each vertex of the
+ set of points and at the circumcircle centers which are the nodes of
+ the Voronoï diagram.
+\item[meshpoint = \meta{value} (default: P):] The letter(s) used to
+ label the vertices of the triangulation. This is included in the math
+ mode delimiters \Verb+$...$+. The bounding box points are labelled
+ with numbers 1 to 4 and with a star exponent.
+\item[circumpoint = \meta{value} (default: P):] The letter(s) used to
+ label the vertices of the Voronoï diagram. This is included in the math
+ mode delimiters \Verb+$...$+.
+\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+ becomes 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
+ axes). It must contain the unit of length (cm,
+ pt, etc.).
+\item[delaunay = none (default) \textme{or} show:] This option
+ allows to draw the Delaunay triangulation under the Voronoï diagram.
+\item[styleDelaunay = none (default) \textme{or} dashed:] This option
+ allows to draw the Delaunay triangulation in dashed lines.
+\item[styleVoronoi = none (default) \textme{or} dashed:] This option
+ allows to draw the Voronoï edges in dashed lines.
+\end{optionsenum}
+
+\begin{Exemple}
+ \buildVoronoiBW[tikz,delaunay=show,styleDelaunay=dashed]
+ {(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)}
+\end{Exemple}
+
+\subsection{The \emph{inc} variant}
+
+Once again, a variant of the macros is available allowing the user to
+add code before and after the code produced by \luamesh. We refer to
+section~\ref{sec:inc} because it works the same way.
+
+Let us note that:
+\begin{itemize}
+\item with MetaPost, the circumcenters are defined using
+ \Verb+pair CircumPoints[];+ and so they are accessible.
+\item With \Verb+tikz+, there are new coordinates defined as follows
+ \begin{latexcode}
+ \coordinate (CircumPoints1) at (...,...);
+ \coordinate (CircumPoints2) at (...,...);
+ \coordinate (CircumPoints3) at (...,...);
+ % etc.
+ \end{latexcode}
+\end{itemize}
+
+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
+exporting format is the \emph{MSH ASCII file format} and can be easily
+read by a Lua program. \luamesh provides the user with dedicated
+macros to read and draw meshes coming from a Gmsh exportation.\bigskip
+
+\commande|\drawGmsh[«options»]{«file name»}|\medskip
+
+This macro draws the triangulation produced by Gmsh and exported in the
+\Verb+msh+ format. The argument is the name of the file to be read
+(e.g.: \Verb+maillage.msh+).
+
+\begin{Exemple}
+\drawGmsh{maillage.msh}
+\end{Exemple}
+
+There are several options to customize the drawing.
+\begin{optionsenum}
+\item[color = \meta{value} (default: black):] The color of the
+ drawing.
+\item[print = none (default) \textme{or} points:] To label the vertices of the
+ triangulation. Contrary to some previous macros, when
+ \Verb+print=none+ a \emph{dot} is produced at each vertex of the
+ set of points and at the circumcircle centers (these are the nodes of
+ the Voronoï diagram).
+\item[meshpoint = \meta{value} (default: P):] The letter(s) used to
+ label the vertices of the triangulation. This is included in the math
+ mode delimiters \Verb+$...$+. The bounding box points are labeled
+ with numbers 1 to 4 and with a star exponent.
+\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+ becomes 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
+ axes). It must contain the unit of length (cm,
+ pt, etc.).
+\end{optionsenum}
+Here is an example:
+\begin{Exemple}
+ \drawGmsh[scale=2cm,print=points, color=blue!30]{maillage.msh}
+\end{Exemple}
+
+\subsection{Gmsh and Voronoï Diagrams}
+
+Because Gmsh generates Delaunay triangulations, we can plot the associated
+Voronoï diagram. This is done by the following macro:\bigskip
+
+\commande|\gmshVoronoi[«options»]{«file name»}|\medskip
+
+\begin{Exemple}
+ \gmshVoronoi{maillage.msh}
+\end{Exemple}
+
+
+\subsection{The Options}\label{sec:voronoiOptions}
+
+
+There are several options to customize the drawing.
+\begin{optionsenum}
+\item[color = \meta{value} (default: black):] The color of the
+ drawing.
+\item[colorVoronoi = \meta{value} (default: black):] The color of the
+ drawing for the elements (points and polygons) belonging to the
+ Voronoï diagram.
+\item[print = none (default) \textme{or} points:] To label the vertices of the
+ triangulation. Contrary to some previous macros, when
+ \Verb+print=none+, a \emph{dot} is produced at each vertex of the
+ set of points and at the circumcircle centers (these are the nodes of
+ the Voronoï diagram).
+\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
+ with numbers 1 to 4 and with a star exponent.
+\item[circumpoint = \meta{value} (default: P):] The letter(s) used to
+ label the vertices of the Voronoï diagram. This is included in the math
+ mode delimiters \Verb+$...$+.
+\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+ becomes 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
+ axes). It must contain the unit of length (cm,
+ pt, etc.).
+\item[delaunay = none (default) \textme{or} show] This option
+ allows to draw the Delaunay triangulation overlapped with the
+ Voronoï diagram.
+\item[styleDelaunay = none (default) \textme{or} dashed] This option
+ allows to draw the Delaunay triangulation in dashed lines.
+\item[styleVoronoi = none (default) \textme{or} dashed] This option
+ allows to draw the Voronoï edges in dashed lines.
+\end{optionsenum}
+
+\begin{Exemple}
+ \gmshVoronoi[tikz,scale=1.5cm, delaunay=show,styleVoronoi=dashed]{maillage.msh}
+\end{Exemple}
+
+
+\subsection{The \emph{inc} variants}
+
+Once again, there exist \emph{inc} variant macros:\bigskip
+
+\commande|\drawGmshinc[«options»]{«file name»}{«code before»}{«code after»}|\medskip
+
+\commande|\gmshVoronoiinc[«options»]{«file name»}{«code before»}{«code after»}|\medskip
+
+We refer to the previous sections for explanations.
+
+
+
+\section{Gallery}
+\subsection{With Animate}
+
+If you use \emph{Adobe Acrobat reader}, you can easily produce an
+animation of the Bowyer and Watson algorithm with the package
+\Verb+animate+.
+
+For example, the following code (in a file name \Verb+animation.tex+):
+\begin{latexcode}
+ \documentclass{article}
+ %% lualatex compilation
+ \usepackage[margin=2.5cm]{geometry}
+ \usepackage{luamesh}
+ \usepackage{fontspec}
+ \usepackage{multido}
+ \pagestyle{empty}
+ \def\drawPath{draw (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle withcolor 0.99white;}
+ \def\clipPath{clip currentpicture to (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle;}
+ \begin{document}
+ \drawPointsMeshinc[mode=ext, bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ \newpage\buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{meshInit.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ \multido{\ii=5+1}{4}{%
+ \newpage\meshAddPointBWinc[mode=ext,step=badtriangles,colorNew
+ =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
+ show,colorBbox = blue!20]{mesh.txt}{\ii}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ } \newpage
+ \meshAddPointBWinc[mode=ext,step=cavity,colorNew
+ =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
+ show,colorBbox = blue!20]{mesh.txt}{\ii}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ } \newpage
+ \meshAddPointBWinc[mode=ext,step=newtriangles,colorNew
+ =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
+ show,colorBbox = blue!20]{mesh.txt}{\ii}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ }
+ \newpage
+ \buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+ \newpage
+ \buildMeshBWinc[mode=ext,print=points]{mesh.txt}%
+ {%
+ beginfig(0);
+ \drawPath
+ }%
+ {%
+ \clipPath
+ endfig;
+ }
+\end{document}
+\end{latexcode}
+produces a PDF with multiple pages. Using the \Verb+pdfcrop+ program,
+we crop the pages to the material, and then we can animate the PDF
+using the \Verb+animate+ package.
+
+%\begin{Exemple}
+%\animategraphics[controls]{1}{animation-crop}{}{}
+%\end{Exemple}
+
+\input{dum.bbl}
+
+\end{document}
+
+
+
+%%% Local Variables:
+%%% flyspell-mode: 1
+%%% ispell-local-dictionary: "american"
+%%% End:
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-title.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-title.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-title.pdf 2017-04-12 21:08:50 UTC (rev 43766)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-title.pdf 2017-04-12 21:12:32 UTC (rev 43767)
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/luamesh-title.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.geo
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.geo (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.geo 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,9 @@
+// Gmsh project created on Tue Nov 29 22:45:35 2016
+Point(1) = {0, 0, 0, .5};
+Point(2) = {3, 0, 0, .5};
+Point(3) = {0, 3, 0, .5};
+Circle(1) = {3, 1, 2};
+Line(2) = {1, 3};
+Line(3) = {2, 1};
+Line Loop (1) = {1,3,2};
+Plane Surface (6) = {1};
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.msh
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.msh (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/maillage.msh 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,160 @@
+$MeshFormat
+2.2 0 8
+$EndMeshFormat
+$Nodes
+50
+1 0 0 0
+2 3 0 0
+3 0 3 0
+4 0.4693033951192702 2.963065021785638 0
+5 0.9270509831224205 2.853169548886248 0
+6 1.361971499215402 2.673019572566753 0
+7 1.763355756873741 2.427050983127515 0
+8 2.121320343555531 2.121320343563755 0
+9 2.427050983122084 1.763355756881216 0
+10 2.673019572563731 1.361971499221335 0
+11 2.853169548884875 0.9270509831266447 0
+12 2.963065021785299 0.4693033951214145 0
+13 0 0.499999999997822 0
+14 0 0.9999999999960245 0
+15 0 1.499999999994285 0
+16 0 1.999999999996158 0
+17 0 2.499999999998079 0
+18 2.500000000003167 0 0
+19 2.000000000001941 0 0
+20 1.500000000004168 0 0
+21 1.00000000000281 0 0
+22 0.5000000000014051 0 0
+23 1.234141133439995 1.234706476168725 0
+24 2.019011585984451 0.8482511421012229 0
+25 0.7996467420535595 2.004579558507475 0
+26 0.7193791167395813 0.7231883013413306 0
+27 1.519111484662544 1.840362994240276 0
+28 1.444230772066577 0.6206006444007433 0
+29 0.6032715654033697 1.482446070099814 0
+30 1.967205997854255 1.422470442749536 0
+31 2.483520846404239 0.5934345676487791 0
+32 0.5639644981111984 2.469590570556198 0
+33 1.323592795170413 2.162102387974417 0
+34 2.468934320532775 1.014872883347498 0
+35 1.818185974210566 0.4238910154260575 0
+36 0.3947241723756524 1.821731472036314 0
+37 1.134164055943625 1.659777451599567 0
+38 1.613471831330844 1.104183945170989 0
+39 0.9806274474984064 2.435458768712165 0
+40 0.4081594929391452 1.008296761660148 0
+41 1.00688752284509 0.4118199261386256 0
+42 0.439071022087537 0.4405508315229876 0
+43 1.118714369352139 0.8621581647343061 0
+44 1.923763789491919 1.798468600466841 0
+45 2.313447213716825 1.312293020670456 0
+46 1.529398659496223 1.467534627005675 0
+47 0.8456544688053689 1.137388163063763 0
+48 1.73022883395083 2.069861061874561 0
+49 2.160830764549087 0.3569017273154402 0
+50 0.3343775807151865 2.155932068334013 0
+$EndNodes
+$Elements
+101
+1 15 2 0 1 1
+2 15 2 0 2 2
+3 15 2 0 3 3
+4 1 2 0 1 3 4
+5 1 2 0 1 4 5
+6 1 2 0 1 5 6
+7 1 2 0 1 6 7
+8 1 2 0 1 7 8
+9 1 2 0 1 8 9
+10 1 2 0 1 9 10
+11 1 2 0 1 10 11
+12 1 2 0 1 11 12
+13 1 2 0 1 12 2
+14 1 2 0 2 1 13
+15 1 2 0 2 13 14
+16 1 2 0 2 14 15
+17 1 2 0 2 15 16
+18 1 2 0 2 16 17
+19 1 2 0 2 17 3
+20 1 2 0 3 2 18
+21 1 2 0 3 18 19
+22 1 2 0 3 19 20
+23 1 2 0 3 20 21
+24 1 2 0 3 21 22
+25 1 2 0 3 22 1
+26 2 2 0 6 12 18 31
+27 2 2 0 6 4 32 17
+28 2 2 0 6 47 37 23
+29 2 2 0 6 29 37 47
+30 2 2 0 6 13 40 42
+31 2 2 0 6 22 42 41
+32 2 2 0 6 17 3 4
+33 2 2 0 6 18 12 2
+34 2 2 0 6 13 14 40
+35 2 2 0 6 21 22 41
+36 2 2 0 6 20 41 28
+37 2 2 0 6 15 29 40
+38 2 2 0 6 25 37 29
+39 2 2 0 6 24 28 38
+40 2 2 0 6 28 43 38
+41 2 2 0 6 23 38 43
+42 2 2 0 6 20 28 35
+43 2 2 0 6 15 36 29
+44 2 2 0 6 11 12 31
+45 2 2 0 6 4 5 32
+46 2 2 0 6 24 35 28
+47 2 2 0 6 25 29 36
+48 2 2 0 6 20 21 41
+49 2 2 0 6 14 15 40
+50 2 2 0 6 24 30 45
+51 2 2 0 6 26 42 40
+52 2 2 0 6 26 41 42
+53 2 2 0 6 11 31 34
+54 2 2 0 6 24 45 34
+55 2 2 0 6 9 30 44
+56 2 2 0 6 6 7 33
+57 2 2 0 6 5 39 32
+58 2 2 0 6 27 37 33
+59 2 2 0 6 9 45 30
+60 2 2 0 6 25 33 37
+61 2 2 0 6 24 38 30
+62 2 2 0 6 1 13 42
+63 2 2 0 6 1 42 22
+64 2 2 0 6 24 31 49
+65 2 2 0 6 25 50 32
+66 2 2 0 6 24 34 31
+67 2 2 0 6 15 16 36
+68 2 2 0 6 19 20 35
+69 2 2 0 6 25 32 39
+70 2 2 0 6 7 48 33
+71 2 2 0 6 24 49 35
+72 2 2 0 6 25 36 50
+73 2 2 0 6 30 46 44
+74 2 2 0 6 8 9 44
+75 2 2 0 6 27 44 46
+76 2 2 0 6 5 6 39
+77 2 2 0 6 6 33 39
+78 2 2 0 6 18 49 31
+79 2 2 0 6 17 32 50
+80 2 2 0 6 10 11 34
+81 2 2 0 6 25 39 33
+82 2 2 0 6 27 33 48
+83 2 2 0 6 18 19 49
+84 2 2 0 6 16 17 50
+85 2 2 0 6 9 10 45
+86 2 2 0 6 7 8 48
+87 2 2 0 6 30 38 46
+88 2 2 0 6 23 43 47
+89 2 2 0 6 27 46 37
+90 2 2 0 6 28 41 43
+91 2 2 0 6 26 43 41
+92 2 2 0 6 23 37 46
+93 2 2 0 6 10 34 45
+94 2 2 0 6 19 35 49
+95 2 2 0 6 16 50 36
+96 2 2 0 6 23 46 38
+97 2 2 0 6 26 40 47
+98 2 2 0 6 29 47 40
+99 2 2 0 6 8 44 48
+100 2 2 0 6 26 47 43
+101 2 2 0 6 27 48 44
+$EndElements
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/mesh.txt
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/mesh.txt (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/mesh.txt 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,7 @@
+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
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/mesh.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamesh/meshgarde.txt
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamesh/meshgarde.txt (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamesh/meshgarde.txt 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,9 @@
+0 0
+6 0
+2 4
+1.5 2
+2. 0.5
+3 2.6
+3.5 1
+5 3.
+0.3 3.2
Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamesh/meshgarde.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/scripts/luamesh/luamesh.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/luamesh/luamesh.lua (rev 0)
+++ trunk/Master/texmf-dist/scripts/luamesh/luamesh.lua 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,545 @@
+require "luamesh-polygon"
+require "luamesh-tex"
+
+local function shallowCopy(original)
+ local copy = {}
+ for key, value in pairs(original) do
+ copy[key] = value
+ end
+ return copy
+end
+
+-- Bowyer and Watson algorithm
+-- Delaunay meshing
+function BowyerWatson (listPoints,bbox)
+ local triangulation = {}
+ lgth = #listPoints
+ -- add four points to listPoints to have a bounding box
+ listPoints = buildBoundingBox(listPoints)
+ -- the first triangle
+ triangulation[1] = {lgth+1, lgth+2, lgth+3,type="bbox"}
+ -- the second triangle
+ triangulation[2] = {lgth+1, lgth+3, lgth+4,type="bbox"}
+ -- add points one by one
+ for i=1,lgth do
+ -- find the triangles which the circumcircle contained the point to add
+ badTriangles = buildBadTriangles(listPoints[i],triangulation,listPoints)
+ -- build the polygon of the cavity containing the point to add
+ polygon = buildCavity(badTriangles, triangulation)
+ -- remove the bad triangles
+ for j=1,#badTriangles do
+ table.remove(triangulation,badTriangles[j]-(j-1))
+ end
+ -- build the new triangles and add them to triangulation
+ for j=1,#polygon do
+ if((polygon[j][1]>lgth) or (polygon[j][2]>lgth) or (i>lgth)) then
+ table.insert(triangulation,{polygon[j][1],polygon[j][2],i,type="bbox"})
+ else
+ table.insert(triangulation,{polygon[j][1],polygon[j][2],i,type="in"})
+ end
+ end
+ end -- end adding points of the listPoints
+ -- remove bounding box
+ if(bbox ~= "bbox") then
+ triangulation = removeBoundingBox(triangulation,lgth)
+ table.remove(listPoints,lgth+1)
+ table.remove(listPoints,lgth+1)
+ table.remove(listPoints,lgth+1)
+ table.remove(listPoints,lgth+1)
+ end
+ return triangulation
+end
+
+
+function buildBoundingBox(listPoints)
+ -- listPoints : list of points
+ -- epsV : parameter for the distance of the bounding box
+ local xmin, xmax, ymin, ymax, eps
+ xmin = 1000
+ ymin = 1000
+ xmax = -1000
+ ymax = -1000
+ for i=1,#listPoints do
+ if (listPoints[i].x < xmin) then
+ xmin = listPoints[i].x
+ end
+ if (listPoints[i].x > xmax) then
+ xmax = listPoints[i].x
+ end
+ if (listPoints[i].y < ymin) then
+ ymin = listPoints[i].y
+ end
+ if (listPoints[i].y > ymax) then
+ ymax = listPoints[i].y
+ end
+ end
+ eps = math.max(math.abs(xmax-xmin),math.abs(ymax-ymin))*0.15
+ xmin = xmin - eps
+ xmax = xmax + eps
+ ymin = ymin - eps
+ ymax = ymax + eps
+ -- add points of the bounding box in last positions
+ table.insert(listPoints,{x=xmin,y=ymin,type="bbox"})
+ table.insert(listPoints,{x=xmin,y=ymax,type="bbox"})
+ table.insert(listPoints,{x=xmax,y=ymax,type="bbox"})
+ table.insert(listPoints,{x=xmax,y=ymin,type="bbox"})
+ return listPoints
+end
+
+function BoundingBox(listPoints)
+ -- listPoints : list of points
+ -- epsV : parameter for the distance of the bounding box
+ local xmin, xmax, ymin, ymax, eps
+ xmin = 1000
+ ymin = 1000
+ xmax = -1000
+ ymax = -1000
+ for i=1,#listPoints do
+ if (listPoints[i].x < xmin) then
+ xmin = listPoints[i].x
+ end
+ if (listPoints[i].x > xmax) then
+ xmax = listPoints[i].x
+ end
+ if (listPoints[i].y < ymin) then
+ ymin = listPoints[i].y
+ end
+ if (listPoints[i].y > ymax) then
+ ymax = listPoints[i].y
+ end
+ end
+ eps = math.max(math.abs(xmax-xmin),math.abs(ymax-ymin))*0.15
+ xmin = xmin - eps
+ xmax = xmax + eps
+ ymin = ymin - eps
+ ymax = ymax + eps
+ return xmin, xmax, ymin, ymax
+end
+
+function removeBoundingBox(triangulation,lgth)
+ -- build the four bounding box edge
+ point1 = lgth+1
+ point2 = lgth+2
+ point3 = lgth+3
+ point4 = lgth+4
+ -- for all triangle
+ local newTriangulation = {}
+ for i=1,#triangulation do
+ boolE1 = pointInTriangle(point1,triangulation[i])
+ boolE2 = pointInTriangle(point2,triangulation[i])
+ boolE3 = pointInTriangle(point3,triangulation[i])
+ boolE4 = pointInTriangle(point4,triangulation[i])
+ if((not boolE1) and (not boolE2) and (not boolE3) and (not boolE4)) then
+ table.insert(newTriangulation,triangulation[i])
+ end
+ end
+ return newTriangulation
+end
+
+
+function buildBadTriangles(point, triangulation,listPoints)
+ local badTriangles = {}
+ for j=1,#triangulation do -- for all triangles
+ A = listPoints[triangulation[j][1]]
+ B = listPoints[triangulation[j][2]]
+ C = listPoints[triangulation[j][3]]
+ center, radius = circoncircle(A,B,C)
+ CP = Vector(center,point)
+ if(VectorNorm(CP)<radius) then -- the point belongs to the circoncirle
+ table.insert(badTriangles,j)
+ end
+ end
+ return badTriangles
+end
+
+-- construction of the cavity composed by the bad triangles around the point to add
+function buildCavity(badTriangles, triangulation)
+ local polygon = {}
+ for j=1,#badTriangles do -- for all bad triangles
+ ind = badTriangles[j]
+ for k=1,3 do -- for all edges
+ edge = {triangulation[ind][k],triangulation[ind][k%3+1]}
+ edgeBord = false
+ for l = 1,#badTriangles do -- for all badtriangles
+ badInd = badTriangles[l]
+ if(badInd ~= ind) then -- if not the current one
+ edgeBord = edgeBord or edgeInTriangle(edge,triangulation[badInd])
+ end
+ end --
+ -- if the edge does not belong to another bad triangle
+ if(edgeBord == false) then
+ -- insert the edge to the cavity
+ table.insert(polygon,edge)
+ end
+ end --
+ end --
+ return polygon
+end
+
+function edgeInTriangle(e,t)
+ in1 = false
+ in2 = false
+ for i=1,3 do
+ if e[1] == t[i] then
+ in1 = true
+ end
+ if e[2] == t[i] then
+ in2 = true
+ end
+ end
+ out = (in1 and in2)
+ return out
+end
+
+function pointInTriangle(e,t)
+ in1 = false
+ for i=1,3 do
+ if e == t[i] then
+ in1 = true
+ end
+ end
+ return in1
+end
+
+
+function Vector(A,B)
+ local out = {x = B.x - A.x, y = B.y - A.y}
+ return out
+end
+
+function VectorNorm(NP)
+ return math.sqrt(NP.x*NP.x +NP.y*NP.y)
+end
+
+-- circoncircle
+function circoncircle(M, N, P)
+ -- Compute center and radius of the circoncircle of the triangle M N P
+
+ -- return : (center [Point],radius [float])
+
+ local MN = Vector(M,N)
+ local NP = Vector(N,P)
+ local PM = Vector(P,M)
+ m = VectorNorm(NP) -- |NP|
+ n = VectorNorm(PM) -- |PM|
+ p = VectorNorm(MN) -- |MN|
+
+ d = (m + n + p) * (-m + n + p) * (m - n + p) * (m + n - p)
+ if d > 0 then
+ rad = m * n * p / math.sqrt(d)
+ else
+ rad = 0
+ end
+ d = -2 * (M.x * NP.y + N.x * PM.y + P.x * MN.y)
+ O = {x=0, y=0}
+ OM = Vector(O, M)
+ ON = Vector(O, N)
+ OP = Vector(O, P)
+ om2 = math.pow(VectorNorm(OM),2) -- |OM|**2
+ on2 = math.pow(VectorNorm(ON),2) -- |ON|**2
+ op2 = math.pow(VectorNorm(OP),2) -- |OP|**2
+ x0 = -(om2 * NP.y + on2 * PM.y + op2 * MN.y) / d
+ y0 = (om2 * NP.x + on2 * PM.x + op2 * MN.x) / d
+ if d == 0 then
+ Out = {nil, nil}
+ else
+ Out = {x=x0, y=y0}
+ end
+ return Out, rad -- (center [Point], R [float])
+end
+
+-- compute the list of the circumcircle of a triangulation
+function listCircumCenter(listPoints,triangulation)
+ local list = {}
+ for j=1,#triangulation do
+ A = listPoints[triangulation[j][1]]
+ B = listPoints[triangulation[j][2]]
+ C = listPoints[triangulation[j][3]]
+ center, radius = circoncircle(A,B,C)
+ table.insert(list,{x=center.x,y=center.y,r=radius})
+ end
+ return list
+end
+
+-- find the three neighbour triangles of T
+function findNeighbour(T,i,triangulation)
+ -- T : triangle
+ -- i : index of T in triangualation
+ -- triangulation
+
+ list = {}
+ -- define the three edge
+ e1 = {T[1],T[2]}
+ e2 = {T[2],T[3]}
+ e3 = {T[3],T[1]}
+ for j=1,#triangulation do
+ if j~= i then
+ if(edgeInTriangle(e1,triangulation[j])) then
+ table.insert(list,j)
+ end
+ if(edgeInTriangle(e2,triangulation[j])) then
+ table.insert(list,j)
+ end
+ if(edgeInTriangle(e3,triangulation[j])) then
+ table.insert(list,j)
+ end
+ end
+ end
+ return list
+end
+
+-- test if edge are the same (reverse)
+function equalEdge(e1,e2)
+ if(((e1[1] == e2[1]) and (e1[2] == e2[2])) or ((e1[1] == e2[2]) and (e1[2] == e2[1]))) then
+ return true
+ else
+ return false
+ end
+end
+
+-- test if the edge belongs to the list
+function edgeInList(e,listE)
+ output = false
+ for i=1,#listE do
+ if(equalEdge(e,listE[i])) then
+ output = true
+ end
+ end
+ return output
+end
+
+-- build the edges of the Voronoi diagram with a given triangulation
+function buildVoronoi(listPoints, triangulation)
+ local listCircumCircle = listCircumCenter(listPoints, triangulation)
+ local listVoronoi = {}
+ for i=1,#listCircumCircle do
+ listN = findNeighbour(triangulation[i],i,triangulation)
+ for j=1,#listN do
+ edge = {i,listN[j]}
+ if( not edgeInList(edge, listVoronoi)) then
+ table.insert(listVoronoi, edge)
+ end
+ end
+ end
+ return listVoronoi
+end
+
+-- build the list of points
+function buildList(chaine, mode)
+ -- if mode = int : the list is given in the chaine string (x1,y1);(x2,y2);...;(xn,yn)
+ -- if mode = ext : the list is given in a file line by line with space separation
+ local listPoints = {}
+ if mode == "int" then
+ local points = string.explode(chaine, ";")
+ local lgth=#points
+ for i=1,lgth do
+ Sx,Sy=string.match(points[i],"%((.+),(.+)%)")
+ listPoints[i]={x=tonumber(Sx),y=tonumber(Sy)}
+ end
+ elseif mode == "ext" then
+ io.input(chaine) -- open the file
+ text=io.read("*all")
+ lines=string.explode(text,"\n+") -- all the lines
+ tablePoints={}
+ for i=1,#lines do
+ xy=string.explode(lines[i]," +")
+ listPoints[i]={x=tonumber(xy[1]),y=tonumber(xy[2])}
+ end
+ else
+ print("Non existing mode")
+ end
+ return listPoints
+end
+
+
+-- function to add points on a polygon to respect
+-- the size of unit mesh
+function addPointsPolygon(polygon,h)
+ local newPolygon = shallowCopy(polygon)
+ k=0 -- to follow in the newPolygon
+ for i=1,#polygon do
+ k = k+1
+ ip = (i)%(#polygon)+1
+ dist = math.sqrt(math.pow(polygon[i].x-polygon[ip].x,2) + math.pow(polygon[i].y-polygon[ip].y,2))
+ -- if the distance between two ponits of the polygon is greater than 1.5*h
+ if(dist>=2*h) then
+ n = math.floor(dist/h)
+ step = dist/(n+1)
+ for j=1,n do
+ a = {x=polygon[i].x+j*step*(polygon[ip].x-polygon[i].x)/dist,y=polygon[i].y+j*step*(polygon[ip].y-polygon[i].y)/dist}
+ table.insert(newPolygon,k+j,a)
+ end
+ k=k+n
+ end
+ end
+ return newPolygon
+end
+
+-- function to build a gridpoints from the bounding box
+-- with a prescribed
+function buildGrid(listPoints,h,random)
+ -- listPoints : list of the points of the polygon, ordered
+ -- h : parameter for the grid
+ xmin, xmax, ymin, ymax = BoundingBox(listPoints)
+
+ local grid = rectangleList(xmin,xmax,ymin,ymax,h,random)
+ return grid
+end
+
+-- function to build the list of points in the rectangle
+function rectangleList(xmin,xmax,ymin,ymax,h,random)
+ -- for the random
+ math.randomseed( os.time() )
+ nbrX = math.floor(math.abs(xmax-xmin)/h)
+ nbrY = math.floor(math.abs(ymax-ymin)/h)
+ local listPoints = {}
+ k=1
+ for i=1,(nbrX+1) do
+ for j=1,(nbrY+1) do
+ rd = math.random()
+ if(random=="perturb") then
+ fact = 0.3*h
+ --print(fact)
+ else
+ fact = 0.0
+ end
+ listPoints[k] = {x = xmin+(i-1)*h+rd*fact, y=ymin+(j-1)*h+rd*fact}
+ k=k+1
+ end
+ end
+ return listPoints
+end
+
+
+-- function to add points from a grid to the interior of a polygon
+function addGridPoints(polygon, grid,h)
+ local listPoints = shallowCopy(polygon)
+ k = #polygon
+ for i=1, #grid do
+ --print(grid[i].x,grid[i].y)
+ --print(isInside(polygon,grid[i]))
+ if(isInside(polygon,grid[i],h)) then
+ k=k+1
+ listPoints[k] = grid[i]
+ end
+ end
+ return listPoints
+end
+
+
+
+-- function give a real polygon without repeting points
+function cleanPoly(polygon)
+ local polyNew = {}
+ local polyCopy = shallowCopy(polygon)
+ e1 = polyCopy[1][1]
+ e2 = polyCopy[1][2]
+ table.insert(polyNew, e1)
+ table.insert(polyNew, e2)
+ table.remove(polyCopy,1)
+ j = 2
+ while #polyCopy>1 do
+ i=1
+ find = false
+ while (i<=#polyCopy and find==false) do
+ bool1 = (polyCopy[i][1] == polyNew[j])
+ bool2 = (polyCopy[i][2] == polyNew[j])
+ if(bool1 or bool2) then -- the edge has a common point with polyNew[j]
+ if(not bool1) then
+ table.insert(polyNew, polyCopy[i][1])
+ find = true
+ table.remove(polyCopy,i)
+ j = j+1
+ elseif(not bool2) then
+ table.insert(polyNew, polyCopy[i][2])
+ find = true
+ table.remove(polyCopy,i)
+ j = j+1
+ end
+ end
+ i=i+1
+ end
+ end
+ return polyNew
+end
+
+
+
+-- build the list of points extern and stop at nbr
+function buildListExt(chaine, stop)
+ local listPoints = {}
+ io.input(chaine) -- open the file
+ text=io.read("*all")
+ lines=string.explode(text,"\n+") -- all the lines
+ for i=1,tonumber(stop) do
+ xy=string.explode(lines[i]," +")
+ table.insert(listPoints,{x=tonumber(xy[1]),y=tonumber(xy[2])})
+ end
+ xy=string.explode(lines[stop+1]," +")
+ point={x=tonumber(xy[1]),y=tonumber(xy[2])}
+ return point, listPoints
+end
+
+function split(pString, pPattern)
+ local Table = {} -- NOTE: use {n = 0} in Lua-5.0
+ local fpat = "(.-)" .. pPattern
+ local last_end = 1
+ local s, e, cap = pString:find(fpat, 1)
+ while s do
+ if s ~= 1 or cap ~= "" then
+ table.insert(Table,cap)
+ end
+ last_end = e+1
+ s, e, cap = pString:find(fpat, last_end)
+ end
+ if last_end <= #pString then
+ cap = pString:sub(last_end)
+ table.insert(Table, cap)
+ end
+ return Table
+end
+
+function readGmsh(file)
+ io.input(file) -- open the file
+ text=io.read("*all")
+ local lines = split(text,"\n+") -- all the lines
+ local listPoints={}
+ local triangulation ={}
+ boolNodes = false
+ Jnodes = 0
+ boolElements = false
+ Jelements = 0
+ J=0
+ for i=1,#lines-J do
+ if(lines[i+J] == "$EndNodes") then
+ boolNodes = false
+ -- go to the next line
+ end
+ if(boolNodes) then -- we are in the Nodes environment
+ xy=split(lines[i+J]," +")
+ table.insert(listPoints,{x=tonumber(xy[2]),y=tonumber(xy[3])})
+ end
+ if(lines[i+J] == "$Nodes") then
+ boolNodes = true
+ -- go to the next line
+ J=J+1
+ end
+ if(lines[i+J] == "$EndElements") then
+ boolElements = false
+ -- go to the next line
+ end
+ if(boolElements) then -- we are in the Nodes environment
+ xy=split(lines[i+J]," +")
+ if(tonumber(xy[2]) == 2) then -- if the element is a triangle
+ nbrTags = xy[3]+1
+ table.insert(triangulation,{tonumber(xy[2+nbrTags+1]),tonumber(xy[2+nbrTags+2]),tonumber(xy[2+nbrTags+3])})
+ end
+ end
+ if(lines[i+J] == "$Elements") then
+ boolElements = true
+ -- go to the next line
+ J=J+1
+ end
+ end
+ return listPoints, triangulation
+end
Property changes on: trunk/Master/texmf-dist/scripts/luamesh/luamesh.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty 2017-04-12 21:12:32 UTC (rev 43767)
@@ -0,0 +1,984 @@
+\NeedsTeXFormat{LaTeX2e}%
+\def\PackageName{luamesh}%
+\def\fileversion{v0.5}%
+\def\filedate{2017/02/09}%
+\ProvidesPackage{luamesh}[\filedate\space\fileversion]%
+%
+% package to load
+\RequirePackage{xkeyval,xcolor,ifthen}%
+%% one global option: mp or tikz
+%\newif\ifluameshmp%
+%\define at key{luamesh.sty}{mp}[]{\luameshmptrue}%
+%\define at key{luamesh.sty}{tikz}[]{\luameshmpfalse}%
+%
+%\RequirePackage{etoolbox} % pour robustifier les commandes
+%
+%
+%\ifluameshmp%
+ \RequirePackage{luamplib}%
+%\else%
+ \RequirePackage{tikz}%
+%\fi%
+%
+% load the lua code
+\directlua{require("luamesh.lua")}%
+%
+%%
+% for tikz (default value)
+% default color for the plot of a global mesh
+\definecolor{TeXCluaMeshTikZ}{rgb}{0.,0.,0.}
+% default color for a new element
+\definecolor{TeXCluaMeshNewTikZ}{rgb}{0.5,0.1,0.1}
+% defaut color for the background of new element
+\definecolor{TeXCluaMeshBackTikZ}{rgb}{0.99,0.85,0.85}
+% default color for circoncircle
+\definecolor{TeXCluaMeshCircleTikZ}{rgb}{0.1,0.6,0.1}
+%%
+%
+%%%%%%%%%%%%%%%% the buildMesh command inc
+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define at boolkey{buildMeshInc}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define at choicekey*{buildMeshInc}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bmi@bbox{none}%
+ \or%
+ \def\luameshval at bmi@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define at key{buildMeshInc}{scale}[1cm]{\def\luameshval at bmi@scale{#1}}%
+%% print ponits ?
+\define at choicekey*{buildMeshInc}{print}[\val\nr]{none, points,dotpoints}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bmi@print{none}%
+ \or%
+ \def\luameshval at bmi@print{points}%
+ \or%
+ \def\luameshval at bmi@print{dotpoints}%
+ \fi%
+}%
+%% the name of the point
+\define at key{buildMeshInc}{meshpoint}[P]{\def\luameshval at bmi@meshpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{buildMeshInc}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bmi@mode{int}%
+ \or%
+ \def\luameshval at bmi@mode{ext}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define at key{buildMeshInc}{color}[black]{\def\luameshval at bmi@color{#1}}%
+%% the name of the color of drawing the bbox
+\define at key{buildMeshInc}{colorBbox}[black]{\def\luameshval at bmi@colorbbox{#1}}%
+%
+\presetkeys{buildMeshInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+%
+\newcommand*{\buildMeshBWinc}[4][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ % #3 : the code to place before the generated one
+ % #4 : the code to place after the generated one
+ \setkeys{buildMeshInc}{#1} %
+ \def\MeshPoint{\luameshval at bmi@meshpoint}%
+ \ifKV at buildMeshInc@tikz% if we are using tikz
+ \directlua{%
+ buildMeshTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at bmi@mode","\luameshval at bmi@print","\luameshval at bmi@bbox","\luameshval at bmi@scale","\luameshval at bmi@color","\luameshval at bmi@colorbbox")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at bmi@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at bmi@colorbbox}%
+ \directlua{%
+ buildMeshMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at bmi@mode","\luameshval at bmi@print","\luameshval at bmi@bbox","\luameshval at bmi@scale")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the buildMeshBW command
+%% the code is complete and we don't have any callbacks
+\define at boolkey{buildMesh}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define at choicekey*{buildMesh}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bm@bbox{none}%
+ \or%
+ \def\luameshval at bm@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define at key{buildMesh}{scale}[1cm]{\def\luameshval at bm@scale{#1}}%
+%% print points
+\define at choicekey*{buildMesh}{print}[\val\nr]{none, points, dotpoints}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bm@print{none}%
+ \or%
+ \def\luameshval at bm@print{points}%
+ \or%
+ \def\luameshval at bm@print{dotpoints}%
+ \fi%
+}%
+%% the name of the point
+\define at key{buildMesh}{meshpoint}[P]{\def\luameshval at bm@meshpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{buildMesh}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bm@mode{int}%
+ \or%
+ \def\luameshval at bm@mode{ext}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define at key{buildMesh}{color}[black]{\def\luameshval at bm@color{#1}}%
+%% the name of the color of drawing the bbox
+\define at key{buildMesh}{colorBbox}[black]{\def\luameshval at bm@colorbbox{#1}}%
+%
+\presetkeys{buildMesh}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+%
+\newcommand{\buildMeshBW}[2][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ \setkeys{buildMesh}{#1} %
+ \def\MeshPoint{\luameshval at bm@meshpoint}%
+ \ifKV at buildMesh@tikz% if we are using tikz
+ \directlua{%
+ buildMeshTikZBW("#2","\luameshval at bm@mode","\luameshval at bm@print","\luameshval at bm@bbox","\luameshval at bm@scale","\luameshval at bm@color","\luameshval at bm@colorbbox")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at bm@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at bm@colorbbox}%
+ \directlua{%
+ buildMeshMPBW("#2","\luameshval at bm@mode","\luameshval at bm@print","\luameshval at bm@bbox","\luameshval at bm@scale")%
+ }%
+ %
+ \fi%
+}%
+%%%%%%%%%%%%%%%% the buildVoronoi command
+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define at boolkey{buildVoronoiInc}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define at choicekey*{buildVoronoiInc}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bvi@bbox{none}%
+ \or%
+ \def\luameshval at bvi@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define at key{buildVoronoiInc}{scale}[1cm]{\def\luameshval at bvi@scale{#1}}%
+%% print ponits ?
+\define at choicekey*{buildVoronoiInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bvi@print{none}%
+ \or%
+ \def\luameshval at bvi@print{points}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define at choicekey*{buildVoronoiInc}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bvi@styleDelaunay{none}%
+ \or%
+ \def\luameshval at bvi@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define at choicekey*{buildVoronoiInc}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bvi@styleVoronoi{none}%
+ \or%
+ \def\luameshval at bvi@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the name of the point
+\define at key{buildVoronoiInc}{meshpoint}[P]{\def\luameshval at bvi@meshpoint{#1}}%
+%% the name of the circum point
+\define at key{buildVoronoiInc}{circumpoint}[P]{\def\luameshval at bvi@circumpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{buildVoronoiInc}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bvi@mode{int}%
+ \or%
+ \def\luameshval at bvi@mode{ext}%
+ \fi%
+}%
+%% the mode for reading the points
+\define at choicekey*{buildVoronoiInc}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bvi@delaunay{none}%
+ \or%
+ \def\luameshval at bvi@delaunay{show}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define at key{buildVoronoiInc}{color}[black]{\def\luameshval at bvi@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define at key{buildVoronoiInc}{colorVoronoi}[red]{\def\luameshval at bvi@colorvoronoi{#1}}%
+%% the name of the color of drawing the bbox
+\define at key{buildVoronoiInc}{colorBbox}[black]{\def\luameshval at bvi@colorbbox{#1}}%
+%
+\presetkeys{buildVoronoiInc}{tikz=false,bbox=none,scale, meshpoint,circumpoint,mode=int,print=none,color,colorVoronoi,colorBbox,delaunay=none,styleDelaunay=none,styleVoronoi=none}{}%
+%
+\newcommand*{\buildVoronoiBWinc}[4][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ % #3 : the code to place before the generated one
+ % #4 : the code to place after the generated one
+ \setkeys{buildVoronoiInc}{#1} %
+ \def\MeshPoint{\luameshval at bvi@meshpoint}%
+ \def\CircumPoint{\luameshval at bvi@circumpoint}%
+ \ifKV at buildVoronoiInc@tikz% if we are using tikz
+ \directlua{%
+ buildVoronoiTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at bvi@mode","\luameshval at bvi@print","\luameshval at bvi@bbox","\luameshval at bvi@scale","\luameshval at bvi@delaunay","\luameshval at bvi@color","\luameshval at bvi@colorbbox","\luameshval at bvi@colorvoronoi","\luameshval at bvi@styleDelaunay","\luameshval at bvi@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at bvi@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at bvi@colorbbox}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval at bvi@colorvoronoi}%
+ \directlua{%
+ buildVoronoiMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at bvi@mode","\luameshval at bvi@print","\luameshval at bvi@bbox","\luameshval at bvi@scale","\luameshval at bvi@delaunay","\luameshval at bvi@styleDelaunay","\luameshval at bvi@styleVoronoi")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the buildVoronoiBW command
+%% the code is complete and we don't have any callbacks
+\define at boolkey{buildVoronoi}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define at choicekey*{buildVoronoi}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bv@bbox{none}%
+ \or%
+ \def\luameshval at bv@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define at key{buildVoronoi}{scale}[1cm]{\def\luameshval at bv@scale{#1}}%
+%% print points
+\define at choicekey*{buildVoronoi}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bv@print{none}%
+ \or%
+ \def\luameshval at bv@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define at key{buildVoronoi}{meshpoint}[P]{\def\luameshval at bv@meshpoint{#1}}%
+%% the name of the circum point
+\define at key{buildVoronoi}{circumpoint}[P]{\def\luameshval at bv@circumpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{buildVoronoi}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bv@mode{int}%
+ \or%
+ \def\luameshval at bv@mode{ext}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define at choicekey*{buildVoronoi}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bv@styleDelaunay{none}%
+ \or%
+ \def\luameshval at bv@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define at choicekey*{buildVoronoi}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bv@styleVoronoi{none}%
+ \or%
+ \def\luameshval at bv@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the mode for reading the points
+\define at choicekey*{buildVoronoi}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at bv@delaunay{none}%
+ \or%
+ \def\luameshval at bv@delaunay{show}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define at key{buildVoronoi}{color}[black]{\def\luameshval at bv@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define at key{buildVoronoi}{colorVoronoi}[red]{\def\luameshval at bv@colorVoronoi{#1}}%
+%% the name of the color of drawing the bbox
+\define at key{buildVoronoi}{colorBbox}[black]{\def\luameshval at bv@colorbbox{#1}}%
+%
+\presetkeys{buildVoronoi}{tikz=false,bbox=none,scale,
+ meshpoint,circumpoint,mode=int,print=none,color,colorVoronoi,colorBbox,delaunay=none,styleDelaunay=none, styleVoronoi=none}{}%
+%
+\newcommand{\buildVoronoiBW}[2][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ \setkeys{buildVoronoi}{#1} %
+ \def\MeshPoint{\luameshval at bv@meshpoint}%
+ \def\CircumPoint{\luameshval at bv@circumpoint}%
+ \ifKV at buildVoronoi@tikz% if we are using tikz
+ \directlua{%
+ buildVoronoiTikZBW("#2","\luameshval at bv@mode","\luameshval at bv@print","\luameshval at bv@bbox","\luameshval at bv@scale","\luameshval at bv@delaunay","\luameshval at bv@color","\luameshval at bv@colorbbox","\luameshval at bv@colorVoronoi","\luameshval at bv@styleDelaunay","\luameshval at bv@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at bv@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at bv@colorbbox}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval at bv@colorVoronoi}%
+ \directlua{%
+ buildVoronoiMPBW("#2","\luameshval at bv@mode","\luameshval at bv@print","\luameshval at bv@bbox","\luameshval at bv@scale","\luameshval at bv@delaunay","\luameshval at bv@styleDelaunay","\luameshval at bv@styleVoronoi")%
+ }%
+ %
+ \fi%
+}%
+%
+%
+%%%%%%%%%%%%%%%%% the draw Points macro
+%% plot the list of points given in argument
+% the engine
+\define at boolkey{drawPoints}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define at choicekey*{drawPoints}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at tp@bbox{none}%
+ \or%
+ \def\luameshval at tp@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define at key{drawPoints}{scale}[1cm]{\def\luameshval at tp@scale{#1}}%
+%% print points
+\define at choicekey*{drawPoints}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval at tp@print{none}%
+ \or%
+ \def\luameshval at tp@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define at key{drawPoints}{meshpoint}[P]{\def\luameshval at tp@meshpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{drawPoints}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at tp@mode{int}%
+ \or%
+ \def\luameshval at tp@mode{ext}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define at key{drawPoints}{color}[black]{\def\luameshval at tp@color{#1}}%
+%% the name of the color of drawing the bbox
+\define at key{drawPoints}{colorBbox}[black]{\def\luameshval at tp@colorbbox{#1}}%
+%
+\presetkeys{drawPoints}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+%
+\newcommand{\drawPointsMesh}[2][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ \setkeys{drawPoints}{#1} %
+ \def\MeshPoint{\luameshval at tp@meshpoint}%
+ \ifKV at drawPoints@tikz% if we are using tikz
+ \directlua{%
+ printPointsTikZ("#2","\luameshval at tp@mode","\luameshval at tp@print","\luameshval at tp@bbox","\luameshval at tp@scale","\luameshval at tp@color","\luameshval at tp@colorbbox")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at tp@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at tp@colorbbox}%
+ \directlua{%
+ printPointsMP("#2","\luameshval at tp@mode","\luameshval at tp@print","\luameshval at tp@bbox","\luameshval at tp@scale")%
+ }%
+ %
+ \fi%
+}%
+%
+
+%%%%%%%%%%%%%%%% the draw Points macro inc with callbacks
+%% engine of drawing
+\define at boolkey{drawPointsInc}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define at choicekey*{drawPointsInc}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at tpi@bbox{none}%
+ \or%
+ \def\luameshval at tpi@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define at key{drawPointsInc}{scale}[1cm]{\def\luameshval at tpi@scale{#1}}%
+%% print points
+\define at choicekey*{drawPointsInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval at tpi@print{none}%
+ \or%
+ \def\luameshval at tpi@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define at key{drawPointsInc}{meshpoint}[P]{\def\luameshval at tpi@meshpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{drawPointsInc}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at tpi@mode{int}%
+ \or%
+ \def\luameshval at tpi@mode{ext}%
+ \fi%
+}%
+%
+% color
+%% the name of the color of drawing
+\define at key{drawPointsInc}{color}[black]{\def\luameshval at tpi@color{#1}}%
+%% the name of the color of drawing the bbox
+\define at key{drawPointsInc}{colorBbox}[black]{\def\luameshval at tpi@colorbbox{#1}}%
+%
+\presetkeys{drawPointsInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand*{\drawPointsMeshinc}[4][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ % #3 : the code to place before the generated one
+ % #4 : the code to place after the generated one
+ \setkeys{drawPointsInc}{#1} %
+ \def\MeshPoint{\luameshval at tpi@meshpoint}%
+ \ifKV at drawPointsInc@tikz% if we are using tikz
+ \directlua{%
+ printPointsTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at tpi@mode","\luameshval at tpi@print","\luameshval at tpi@bbox","\luameshval at tpi@scale","\luameshval at tpi@color","\luameshval at tpi@colorbbox")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at tpi@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at tpi@colorbbox}%
+ \directlua{%
+ printPointsMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at tpi@mode","\luameshval at tpi@print","\luameshval at tpi@bbox","\luameshval at tpi@scale")%
+ }%
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% the meshAddOnePointBW commande
+%%engine of draiwng
+\define at boolkey{MeshAddOneBW}{tikz}[true]{}%
+%% the scale
+\define at key{MeshAddOneBW}{scale}[1cm]{\def\luameshval at ap@scale{#1}}%
+%% the name of the points
+\define at key{MeshAddOneBW}{meshpoint}[P]{\def\luameshval at ap@meshpoint{#1}}%
+%% the name of the new point
+\define at key{MeshAddOneBW}{newpoint}[P]{\def\luameshval at ap@newpoint{#1}}%
+%% a complete picture or some code of the engine
+\define at choicekey*{MeshAddOneBW}{step}[\val\nr]{badtriangles, cavity, newtriangles}{%
+ \ifcase\nr\relax%
+ \def\luameshval at ap@step{badT}%
+ \or%
+ \def\luameshval at ap@step{cavity}%
+ \or%
+ \def\luameshval at ap@step{newT}%
+ \fi%
+}%
+% color
+%% the color of drawing
+\define at key{MeshAddOneBW}{color}[black]{\def\luameshval at ap@color{#1}}%
+%% the color of background of new element
+\define at key{MeshAddOneBW}{colorBack}[black!20]{\def\luameshval at ap@colorback{#1}}%
+%% the color of new element
+\define at key{MeshAddOneBW}{colorNew}[red]{\def\luameshval at ap@colornew{#1}}%
+%% the color of circoncircle
+\define at key{MeshAddOneBW}{colorCircle}[green]{\def\luameshval at ap@colorcircle{#1}}%
+%% the name of the color of drawing the bbox
+\define at key{MeshAddOneBW}{colorBbox}[black]{\def\luameshval at ap@colorbbox{#1}}%
+%
+%% a complete picture or some code of the engine
+\define at choicekey*{MeshAddOneBW}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at ap@mode{int}%
+ \or%
+ \def\luameshval at ap@mode{ext}%
+ \fi%
+}%
+\define at choicekey*{MeshAddOneBW}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at ap@bbox{none}%
+ \or%
+ \def\luameshval at ap@bbox{bbox}%
+ \fi%
+}%
+\presetkeys{MeshAddOneBW}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,bbox=none,colorBbox}{}%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand*{\meshAddPointBW}[3][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ \setkeys{MeshAddOneBW}{#1} %
+ \def\MeshPoint{\luameshval at ap@meshpoint}%
+ \def\NewPoint{\luameshval at ap@newpoint}%
+ \ifKV at MeshAddOneBW@tikz% if we are using tikz
+ \directlua{%
+ TeXOnePointTikZBW("#2","#3","\luameshval at ap@step","\luameshval at ap@scale","\luameshval at ap@mode","\luameshval at ap@bbox","\luameshval at ap@color","\luameshval at ap@colorback","\luameshval at ap@colornew","\luameshval at ap@colorcircle","\luameshval at ap@colorbbox")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at ap@color}
+ \mplibcolor{\luameshmpcolorBack}{\luameshval at ap@colorback}
+ \mplibcolor{\luameshmpcolorNew}{\luameshval at ap@colornew}
+ \mplibcolor{\luameshmpcolorCircle}{\luameshval at ap@colorcircle}
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at ap@colorbbox}
+ \directlua{%
+ TeXOnePointMPBW("#2","#3","\luameshval at ap@step","\luameshval at ap@scale","\luameshval at ap@mode","\luameshval at ap@bbox")%
+ }%
+ %
+ \fi%
+}%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% the meshAddPointBWinc commande with callbacks
+%% engine of drawing
+\define at boolkey{MeshAddOneBWinc}{tikz}[true]{}%
+%% the scale
+\define at key{MeshAddOneBWinc}{scale}[1cm]{\def\luameshval at api@scale{#1}}%
+%% the name of the points
+\define at key{MeshAddOneBWinc}{meshpoint}[P]{\def\luameshval at api@meshpoint{#1}}%
+%% the name of the new point
+\define at key{MeshAddOneBWinc}{newpoint}[P]{\def\luameshval at api@newpoint{#1}}%
+%% a complete picture or some code of the engine
+\define at choicekey*{MeshAddOneBWinc}{step}[\val\nr]{badtriangles, cavity, newtriangles}{%
+ \ifcase\nr\relax%
+ \def\luameshval at api@step{badT}%
+ \or%
+ \def\luameshval at api@step{cavity}%
+ \or%
+ \def\luameshval at api@step{newT}%
+ \fi%
+}%
+% color
+%% the color of drawing
+\define at key{MeshAddOneBWinc}{color}[black]{\def\luameshval at api@color{#1}}%
+%% the color of background of new element
+\define at key{MeshAddOneBWinc}{colorBack}[black!20]{\def\luameshval at api@colorback{#1}}%
+%% the color of new element
+\define at key{MeshAddOneBWinc}{colorNew}[red]{\def\luameshval at api@colornew{#1}}%
+%% the color of circoncircle
+\define at key{MeshAddOneBWinc}{colorCircle}[green]{\def\luameshval at api@colorcircle{#1}}%
+\define at key{MeshAddOneBWinc}{colorBbox}[black]{\def\luameshval at api@colorbbox{#1}}%
+%
+%% a complete picture or some code of the engine
+\define at choicekey*{MeshAddOneBWinc}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at api@mode{int}%
+ \or%
+ \def\luameshval at api@mode{ext}%
+ \fi%
+}%
+\define at choicekey*{MeshAddOneBWinc}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at api@bbox{none}%
+ \or%
+ \def\luameshval at api@bbox{bbox}%
+ \fi%
+}%
+\presetkeys{MeshAddOneBWinc}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,bbox=none,colorBbox}{}%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand*{\meshAddPointBWinc}[5][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ % #3 : the code to place before the generated one
+ % #4 : the code to place after the generated one
+ \setkeys{MeshAddOneBWinc}{#1} %
+ \def\MeshPoint{\luameshval at api@meshpoint}%
+ \def\NewPoint{\luameshval at api@newpoint}%
+ \ifKV at MeshAddOneBWinc@tikz% if we are using tikz
+ \directlua{%
+ TeXOnePointTikZBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval at ap@step","\luameshval at ap@scale","\luameshval at ap@mode","\luameshval at ap@bbox","\luameshval at ap@color","\luameshval at ap@colorback","\luameshval at ap@colornew","\luameshval at ap@colorcircle","\luameshval at ap@colorbbox")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at api@color}
+ \mplibcolor{\luameshmpcolorBack}{\luameshval at api@colorback}
+ \mplibcolor{\luameshmpcolorNew}{\luameshval at api@colornew}
+ \mplibcolor{\luameshmpcolorCircle}{\luameshval at api@colorcircle}
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval at api@colorbbox}
+ \directlua{%
+ TeXOnePointMPBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval at api@step","\luameshval at api@scale","\luameshval at api@mode","\luameshval at api@bbox")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the drawGmsh command inc
+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define at boolkey{drawGmshInc}{tikz}[true]{}%
+%% the scale
+\define at key{drawGmshInc}{scale}[1cm]{\def\luameshvaldgi at scale{#1}}%
+%% print ponits ?
+\define at choicekey*{drawGmshInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshvaldgi at print{none}%
+ \or%
+ \def\luameshvaldgi at print{points}%
+ \fi%
+}%
+%% the name of the point
+\define at key{drawGmshInc}{meshpoint}[P]{\def\luameshvaldgi at meshpoint{#1}}%
+%% the name of the color of drawing
+\define at key{drawGmshInc}{color}[black]{\def\luameshvaldgi at color{#1}}%
+%
+\presetkeys{drawGmshInc}{tikz=false,scale, meshpoint,print=none,color}{}%
+%
+\newcommand*{\drawGmshinc}[4][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the gmsh file
+ % #3 : the code to place before the generated one
+ % #4 : the code to place after the generated one
+ \setkeys{drawGmshInc}{#1} %
+ \def\MeshPoint{\luameshvaldgi at meshpoint}%
+ \ifKV at drawGmshInc@tikz% if we are using tikz
+ \directlua{%
+ drawGmshTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi at print","\luameshvaldgi at scale","\luameshvaldgi at color")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshvaldgi at color}%
+ \directlua{%
+ drawGmshMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi at print","\luameshvaldgi at scale")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the drawGmshBW command
+%% the code is complete and we don't have any callbacks
+\define at boolkey{drawGmsh}{tikz}[true]{}%
+%% the scale
+\define at key{drawGmsh}{scale}[1cm]{\def\luameshvaldg at scale{#1}}%
+%% print points
+\define at choicekey*{drawGmsh}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshvaldg at print{none}%
+ \or%
+ \def\luameshvaldg at print{points}%
+ \fi%
+}%
+%% the name of the point
+\define at key{drawGmsh}{meshpoint}[P]{\def\luameshvaldg at meshpoint{#1}}%
+%% the name of the color of drawing
+\define at key{drawGmsh}{color}[black]{\def\luameshvaldg at color{#1}}%
+%
+\presetkeys{drawGmsh}{tikz=false,scale, meshpoint,print=none,color}{}%
+%
+\newcommand{\drawGmsh}[2][]{%
+ % #1 : optionnal arguments
+ % #2 : the gmsh file
+ \setkeys{drawGmsh}{#1} %
+ \def\MeshPoint{\luameshvaldg at meshpoint}%
+ \ifKV at drawGmsh@tikz% if we are using tikz
+ \directlua{%
+ drawGmshTikZ("#2","\luameshvaldg at print","\luameshvaldg at scale","\luameshvaldg at color")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshvaldg at color}%
+ \directlua{%
+ drawGmshMP("#2","\luameshvaldg at print","\luameshvaldg at scale")%
+ }%
+ %
+ \fi%
+}%
+%%%%%%%%%%%%%%%% the gmshVoronoi command
+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define at boolkey{gmshVoronoiInc}{tikz}[true]{}%
+%% the scale
+\define at key{gmshVoronoiInc}{scale}[1cm]{\def\luameshval at gvi@scale{#1}}%
+%% print ponits ?
+\define at choicekey*{gmshVoronoiInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gvi@print{none}%
+ \or%
+ \def\luameshval at gvi@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define at key{gmshVoronoiInc}{meshpoint}[P]{\def\luameshval at gvi@meshpoint{#1}}%
+%% the name of the circum point
+\define at key{gmshVoronoiInc}{circumpoint}[P]{\def\luameshval at gvi@circumpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{gmshVoronoiInc}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gvi@delaunay{none}%
+ \or%
+ \def\luameshval at gvi@delaunay{show}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define at choicekey*{gmshVoronoiInc}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gvi@styleDelaunay{none}%
+ \or%
+ \def\luameshval at gvi@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define at choicekey*{gmshVoronoiInc}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gvi@styleVoronoi{none}%
+ \or%
+ \def\luameshval at gvi@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define at key{gmshVoronoiInc}{color}[black]{\def\luameshval at gvi@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define at key{gmshVoronoiInc}{colorVoronoi}[red]{\def\luameshval at gvi@colorvoronoi{#1}}%
+%
+\presetkeys{gmshVoronoiInc}{tikz=false,scale,
+ meshpoint,circumpoint,print=none,color,colorVoronoi,delaunay=none,styleVoronoi=none, styleDelaunay=none}{}%
+%
+\newcommand*{\gmshVoronoiinc}[4][]{%
+ % #1 : optionnal arguments
+ % #2 : the gmsh file
+ % #3 : the code to place before the generated one
+ % #4 : the code to place after the generated one
+ \setkeys{gmshVoronoiInc}{#1} %
+ \def\MeshPoint{\luameshval at gvi@meshpoint}%
+ \def\CircumPoint{\luameshval at gvi@circumpoint}%
+ \ifKV at gmshVoronoiInc@tikz% if we are using tikz
+ \directlua{%
+ gmshVoronoiTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at gvi@print","\luameshval at gvi@scale","\luameshval at gvi@delaunay","\luameshval at gvi@color","\luameshval at gvi@colorvoronoi","\luameshval at gvi@styleDelaunay","\luameshval at gvi@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at gvi@color}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval at gvi@colorvoronoi}%
+ \directlua{%
+ gmshVoronoiMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at gvi@print","\luameshval at gvi@scale","\luameshval at gvi@delaunay","\luameshval at gvi@styleDelaunay","\luameshval at gvi@styleVoronoi")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the gmshVoronoiBW command
+%% the code is complete and we don't have any callbacks
+\define at boolkey{gmshVoronoi}{tikz}[true]{}%
+%% the scale
+\define at key{gmshVoronoi}{scale}[1cm]{\def\luameshval at gv@scale{#1}}%
+%% print points
+\define at choicekey*{gmshVoronoi}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gv@print{none}%
+ \or%
+ \def\luameshval at gv@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define at key{gmshVoronoi}{meshpoint}[P]{\def\luameshval at gv@meshpoint{#1}}%
+%% the name of the circum point
+\define at key{gmshVoronoi}{circumpoint}[P]{\def\luameshval at gv@circumpoint{#1}}%
+%% the mode for reading the points
+\define at choicekey*{gmshVoronoi}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gv@delaunay{none}%
+ \or%
+ \def\luameshval at gv@delaunay{show}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define at choicekey*{gmshVoronoi}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gv@styleDelaunay{none}%
+ \or%
+ \def\luameshval at gv@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define at choicekey*{gmshVoronoi}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval at gv@styleVoronoi{none}%
+ \or%
+ \def\luameshval at gv@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define at key{gmshVoronoi}{color}[black]{\def\luameshval at gv@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define at key{gmshVoronoi}{colorVoronoi}[red]{\def\luameshval at gv@colorVoronoi{#1}}%
+%
+\presetkeys{gmshVoronoi}{tikz=false,scale, meshpoint,circumpoint,print=none,color,colorVoronoi,delaunay=none,styleVoronoi=none, styleDelaunay=none}{}%
+%
+\newcommand{\gmshVoronoi}[2][]{%
+ % #1 : optionnal arguments
+ % #2 : the gmsh file
+ \setkeys{gmshVoronoi}{#1} %
+ \def\MeshPoint{\luameshval at gv@meshpoint}%
+ \def\CircumPoint{\luameshval at gv@circumpoint}%
+ \ifKV at gmshVoronoi@tikz% if we are using tikz
+ \directlua{%
+ gmshVoronoiTikZ("#2","\luameshval at gv@print","\luameshval at gv@scale","\luameshval at gv@delaunay","\luameshval at gv@color","\luameshval at gv@colorVoronoi","\luameshval at gv@styleDelaunay","\luameshval at gv@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at gv@color}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval at gv@colorVoronoi}%
+ \directlua{%
+ gmshVoronoiMP("#2","\luameshval at gv@print","\luameshval at gv@scale","\luameshval at gv@delaunay","\luameshval at gv@styleDelaunay","\luameshval at gv@styleVoronoi")%
+ }%
+ %
+ \fi%
+}%
+%
+%
+%
+%%%%%%%%%%%%%%%% the meshPolygon command
+%%
+\define at boolkey{meshPolygon}{tikz}[true]{}%
+
+%% the scale
+\define at key{meshPolygon}{scale}[1cm]{\def\luameshval at mp@scale{#1}}%
+%% print points
+\define at choicekey*{meshPolygon}{print}[\val\nr]{none, points,dotpoints}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mp@print{none}%
+ \or%
+ \def\luameshval at mp@print{points}%
+ \or%
+ \def\luameshval at mp@print{dotpoints}%
+ \fi%
+}%
+%% the name of the point
+\define at key{meshPolygon}{meshpoint}[P]{\def\luameshval at mp@meshpoint{#1}}%
+%% the grid parameter
+\define at key{meshPolygon}{h}[0.2]{\def\luameshval at mp@h{#1}}%
+%% the mode for reading the points
+\define at choicekey*{meshPolygon}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mp@mode{int}%
+ \or%
+ \def\luameshval at mp@mode{ext}%
+ \fi%
+}%
+%% the mode for the generation of gridpoints
+\define at choicekey*{meshPolygon}{gridpoints}[\val\nr]{rect, perturb}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mp@gridpoints{rect}%
+ \or%
+ \def\luameshval at mp@gridpoints{perturb}%
+ \fi%
+}%
+%% the different steps of the meshing
+\define at choicekey*{meshPolygon}{step}[\val\nr]{polygon, grid, points, mesh}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mp@step{polygon}%
+ \or%
+ \def\luameshval at mp@step{grid}%
+ \or%
+ \def\luameshval at mp@step{points}%
+ \or%
+ \def\luameshval at mp@step{mesh}%
+ \fi%
+}%
+
+%% the name of the color of drawing
+\define at key{meshPolygon}{color}[black]{\def\luameshval at mp@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define at key{meshPolygon}{colorPolygon}[red]{\def\luameshval at mp@colorPolygon{#1}}%
+%% the name of the color of drawing the bbox
+%
+\presetkeys{meshPolygon}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect}{}%
+%
+\newcommand{\meshPolygon}[2][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ \setkeys{meshPolygon}{#1} %
+ \def\MeshPoint{\luameshval at mp@meshpoint}%
+ \ifKV at meshPolygon@tikz% if we are using tikz
+ \directlua{%
+ drawMeshPolygonTikZ("#2","\luameshval at mp@mode","\luameshval at mp@h","\luameshval at mp@step","\luameshval at mp@print","\luameshval at mp@scale","\luameshval at mp@color","\luameshval at mp@colorPolygon","\luameshval at mp@gridpoints")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at mp@color}%
+ \mplibcolor{\luameshmpcolorPoly}{\luameshval at mp@colorPolygon}%
+ \directlua{%
+ drawMeshPolygonMP("#2","\luameshval at mp@mode","\luameshval at mp@h","\luameshval at mp@step","\luameshval at mp@print","\luameshval at mp@scale","\luameshval at mp@gridpoints")%
+ }%
+ %
+ \fi%
+}%
+%%%%%%%%%%%%%%%% the meshPolygonInc command
+%%
+\define at boolkey{meshPolygonInc}{tikz}[true]{}%
+
+%% the scale
+\define at key{meshPolygonInc}{scale}[1cm]{\def\luameshval at mpi@scale{#1}}%
+%% print points
+\define at choicekey*{meshPolygonInc}{print}[\val\nr]{none, points,dotpoints}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mpi@print{none}%
+ \or%
+ \def\luameshval at mpi@print{points}%
+ \or%
+ \def\luameshval at mpi@print{dotpoints}%
+ \fi%
+}%
+%% the mode for the generation of gridpoints
+\define at choicekey*{meshPolygonInc}{gridpoints}[\val\nr]{rect, perturb}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mpi@gridpoints{rect}%
+ \or%
+ \def\luameshval at mpi@gridpoints{perturb}%
+ \fi%
+}%
+%% the name of the point
+\define at key{meshPolygonInc}{meshpoint}[P]{\def\luameshval at mpi@meshpoint{#1}}%
+%% the grid parameter
+\define at key{meshPolygonInc}{h}[0.2]{\def\luameshval at mpi@h{#1}}%
+%% the mode for reading the points
+\define at choicekey*{meshPolygonInc}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mpi@mode{int}%
+ \or%
+ \def\luameshval at mpi@mode{ext}%
+ \fi%
+}%
+%% the different steps of the meshing
+\define at choicekey*{meshPolygonInc}{step}[\val\nr]{polygon, grid, points, mesh}{%
+ \ifcase\nr\relax%
+ \def\luameshval at mpi@step{polygon}%
+ \or%
+ \def\luameshval at mpi@step{grid}%
+ \or%
+ \def\luameshval at mpi@step{points}%
+ \or%
+ \def\luameshval at mpi@step{mesh}%
+ \fi%
+}%
+
+%% the name of the color of drawing
+\define at key{meshPolygonInc}{color}[black]{\def\luameshval at mpi@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define at key{meshPolygonInc}{colorPolygon}[red]{\def\luameshval at mpi@colorPolygon{#1}}%
+%% the name of the color of drawing the bbox
+%
+\presetkeys{meshPolygonInc}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect}{}%
+%
+\newcommand{\meshPolygonInc}[4][]{%
+ % #1 : optionnal arguments
+ % #2 : the string containing the list of points
+ % (x1,y1);(x2,y2);... or the name file containing the points
+ % #3 : the code to place before the generated one
+ % #4 : the code to place after the generated one
+ \setkeys{meshPolygonInc}{#1} %
+ \def\MeshPoint{\luameshval at mpi@meshpoint}%
+ \ifKV at meshPolygonInc@tikz% if we are using tikz
+ \directlua{%
+ drawMeshPolygonTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at mpi@mode","\luameshval at mpi@h","\luameshval at mpi@step","\luameshval at mpi@print","\luameshval at mpi@scale","\luameshval at mpi@color","\luameshval at mpi@colorPolygon","\luameshval at mpi@gridpoints")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval at mpi@color}%
+ \mplibcolor{\luameshmpcolorPoly}{\luameshval at mpi@colorPolygon}%
+ \directlua{%
+ drawMeshPolygonMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval at mpi@mode","\luameshval at mpi@h","\luameshval at mpi@step","\luameshval at mpi@print","\luameshval at mpi@scale","\luameshval at mpi@gridpoints")%
+ }%
+ %
+ \fi%
+}%
Property changes on: trunk/Master/texmf-dist/tex/lualatex/luamesh/luamesh.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2017-04-12 21:08:50 UTC (rev 43766)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2017-04-12 21:12:32 UTC (rev 43767)
@@ -387,7 +387,7 @@
lua2dox luabibentry luabidi luacode luahyphenrules
luaindex luainputenc luaintro lualatex-doc lualatex-doc-de
lualatex-math lualibs
- luamplib luaotfload
+ luamesh luamplib luaotfload
luasseq luatex85 luatexbase luatexja luatexko luatextra
luatodonotes luaxml
lwarp lxfonts ly1
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2017-04-12 21:08:50 UTC (rev 43766)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2017-04-12 21:12:32 UTC (rev 43767)
@@ -678,6 +678,7 @@
'ltxmisc', "die 'skipping, too complicated, sorry'",
'ltxtable', "die 'skipping, use carlisle'",
'lua-visual-debug', "&MAKEflatten",
+ 'luamesh', "&MAKEflatten",
'luatex-def', "die 'skipping, replaced by graphics-def'",
'lucida', "die 'skipping, nonfree font'",
'lucidabr', "die 'skipping, nonfree font'",
@@ -1676,6 +1677,7 @@
'lua2dox', 'NULL', # .def is lua code
'luaintro', 'NULL', # doc pkg
'lualatex-math', '\.sty', # not phst-doc.cls
+ 'luamesh', '\.sty', # not lltxdoc.cls
'luatexko', '\.lua|' . $standardtex,
'luatodonotes','\.lua|' . $standardtex,
'luaxml', '\.lua|' . $standardtex,
@@ -2529,6 +2531,7 @@
'hatching', '[^e].mp', # no htchuse.mp
'latexmp', 'latexmp.mp',
'latex-graphics-companion', 'NULL', # doc package
+ 'luamesh', 'NULL', # not doc file fond.mp
'mcf2graph', 'mcf2graph.mf', # not the examples
'metapost-examples', 'NULL', # doc package
'mpattern', 'mpattern.mp', # don't install test.mp
@@ -2747,6 +2750,7 @@
'lua2dox' => '\.(lua|def)$',
'luaindex' => '\.lua$',
'lualatex-math' => '\.lua$',
+ 'luamesh' => '\.lua$',
'luasseq' => '\.lua$',
'make4ht' => 'filters|\.lua$',
'mycv' => 'mycv_split_contents\.pl',
Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2017-04-12 21:08:50 UTC (rev 43766)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2017-04-12 21:12:32 UTC (rev 43767)
@@ -67,6 +67,7 @@
depend latex-make
depend lpic
depend lroundrect
+depend luamesh
depend makeshape
depend mathspic
depend miniplot
Added: trunk/Master/tlpkg/tlpsrc/luamesh.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list