\NeedsTeXFormat{LaTeX2e}%
\def\PackageName{luamesh}%
-\def\fileversion{v0.1}%
-\def\filedate{2016/11/20}%
+\def\fileversion{v0.2}%
+\def\filedate{2016/11/29}%
\ProvidesPackage{luamesh}[\filedate\space\fileversion]%
%
% package to load
%\define@key{luamesh.sty}{mp}[]{\luameshmptrue}%
%\define@key{luamesh.sty}{tikz}[]{\luameshmpfalse}%
%
-\RequirePackage{etoolbox} % pour robustifier les commandes
+%\RequirePackage{etoolbox} % pour robustifier les commandes
%
%
%\ifluameshmp%
%\fi%
%
% load the lua code
-\directlua{dofile("luamesh.lua")}%
+\directlua{require("luamesh.lua")}%
%
%%
% for tikz (default value)
\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
+%%
+%
+%%%%%%%%%%%%%%%% the buildMesh command inc
%% the user can write code (tikz or MP)
%% before and after the generated code
\define@boolkey{buildMeshInc}{tikz}[true]{}%
% (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{buildMesh}{#1} %
+ \setkeys{buildMeshInc}{#1} %
\def\MeshPoint{\luameshval@bmi@meshpoint}%
- \ifKV@buildMesh@tikz% if we are using tikz
+ \ifKV@buildMeshInc@tikz% if we are using tikz
\directlua{%
- buildMeshTikZ("#2","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","full","\luameshval@bmi@scale","\luameshval@bmi@color")%
+ buildMeshTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale","\luameshval@bmi@color","\luameshval@bmi@colorbbox")%
}%
\else % we are using MP
- \mplibcolor{\luameshmpcolor}{\luameshval@bmi@color}
- \mplibcolor{\luameshmpcolorBbox}{\luameshval@bmi@colorbbox}
+ \mplibcolor{\luameshmpcolor}{\luameshval@bmi@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval@bmi@colorbbox}%
\directlua{%
- buildMeshMPBWinc("#2","#3","#4","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale")%
+ buildMeshMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale")%
}%
%
\fi%
\def\MeshPoint{\luameshval@bm@meshpoint}%
\ifKV@buildMesh@tikz% if we are using tikz
\directlua{%
- buildMeshTikZ("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","full","\luameshval@bm@scale","\luameshval@bm@color")%
+ buildMeshTikZBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale","\luameshval@bm@color","\luameshval@bm@colorbbox")%
}%
\else % we are using MP
- \mplibcolor{\luameshmpcolor}{\luameshval@bm@color}
- \mplibcolor{\luameshmpcolorBbox}{\luameshval@bm@colorbbox}
+ \mplibcolor{\luameshmpcolor}{\luameshval@bm@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval@bm@colorbbox}%
\directlua{%
buildMeshMPBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale")%
}%
%
\fi%
}%
+%%%%%%%%%%%%%%%% the buildVoronoi command
+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define@boolkey{buildVoronoiInc}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define@choicekey*{buildVoronoiInc}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bvi@bbox{none}%
+ \or%
+ \def\luameshval@bvi@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define@key{buildVoronoiInc}{scale}[1cm]{\def\luameshval@bvi@scale{#1}}%
+%% print ponits ?
+\define@choicekey*{buildVoronoiInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bvi@print{none}%
+ \or%
+ \def\luameshval@bvi@print{points}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define@choicekey*{buildVoronoiInc}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bvi@styleDelaunay{none}%
+ \or%
+ \def\luameshval@bvi@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define@choicekey*{buildVoronoiInc}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bvi@styleVoronoi{none}%
+ \or%
+ \def\luameshval@bvi@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the name of the point
+\define@key{buildVoronoiInc}{meshpoint}[P]{\def\luameshval@bvi@meshpoint{#1}}%
+%% the name of the circum point
+\define@key{buildVoronoiInc}{circumpoint}[P]{\def\luameshval@bvi@circumpoint{#1}}%
+%% the mode for reading the points
+\define@choicekey*{buildVoronoiInc}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bvi@mode{int}%
+ \or%
+ \def\luameshval@bvi@mode{ext}%
+ \fi%
+}%
+%% the mode for reading the points
+\define@choicekey*{buildVoronoiInc}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bvi@delaunay{none}%
+ \or%
+ \def\luameshval@bvi@delaunay{show}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define@key{buildVoronoiInc}{color}[black]{\def\luameshval@bvi@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define@key{buildVoronoiInc}{colorVoronoi}[red]{\def\luameshval@bvi@colorvoronoi{#1}}%
+%% the name of the color of drawing the bbox
+\define@key{buildVoronoiInc}{colorBbox}[black]{\def\luameshval@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@bvi@meshpoint}%
+ \def\CircumPoint{\luameshval@bvi@circumpoint}%
+ \ifKV@buildVoronoiInc@tikz% if we are using tikz
+ \directlua{%
+ buildVoronoiTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@color","\luameshval@bvi@colorbbox","\luameshval@bvi@colorvoronoi","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval@bvi@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval@bvi@colorbbox}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@bvi@colorvoronoi}%
+ \directlua{%
+ buildVoronoiMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi")%
+ }%
+ %
+ \fi%
+}%
%
+%%%%%%%%%%%%%%%% the buildVoronoiBW command
+%% the code is complete and we don't have any callbacks
+\define@boolkey{buildVoronoi}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define@choicekey*{buildVoronoi}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bv@bbox{none}%
+ \or%
+ \def\luameshval@bv@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define@key{buildVoronoi}{scale}[1cm]{\def\luameshval@bv@scale{#1}}%
+%% print points
+\define@choicekey*{buildVoronoi}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bv@print{none}%
+ \or%
+ \def\luameshval@bv@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define@key{buildVoronoi}{meshpoint}[P]{\def\luameshval@bv@meshpoint{#1}}%
+%% the name of the circum point
+\define@key{buildVoronoi}{circumpoint}[P]{\def\luameshval@bv@circumpoint{#1}}%
+%% the mode for reading the points
+\define@choicekey*{buildVoronoi}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bv@mode{int}%
+ \or%
+ \def\luameshval@bv@mode{ext}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define@choicekey*{buildVoronoi}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bv@styleDelaunay{none}%
+ \or%
+ \def\luameshval@bv@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define@choicekey*{buildVoronoi}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bv@styleVoronoi{none}%
+ \or%
+ \def\luameshval@bv@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the mode for reading the points
+\define@choicekey*{buildVoronoi}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bv@delaunay{none}%
+ \or%
+ \def\luameshval@bv@delaunay{show}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define@key{buildVoronoi}{color}[black]{\def\luameshval@bv@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define@key{buildVoronoi}{colorVoronoi}[red]{\def\luameshval@bv@colorVoronoi{#1}}%
+%% the name of the color of drawing the bbox
+\define@key{buildVoronoi}{colorBbox}[black]{\def\luameshval@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}{}%
%
-%%%%%%%%%%%%%%%%% the trace Points macro
+\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@bv@meshpoint}%
+ \def\CircumPoint{\luameshval@bv@circumpoint}%
+ \ifKV@buildVoronoi@tikz% if we are using tikz
+ \directlua{%
+ buildVoronoiTikZBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@color","\luameshval@bv@colorbbox","\luameshval@bv@colorVoronoi","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval@bv@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval@bv@colorbbox}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@bv@colorVoronoi}%
+ \directlua{%
+ buildVoronoiMPBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi")%
+ }%
+ %
+ \fi%
+}%
+%
+%
+%%%%%%%%%%%%%%%%% the draw Points macro
%% plot the list of points given in argument
% the engine
-\define@boolkey{tracePoints}{tikz}[true]{}%
+\define@boolkey{drawPoints}{tikz}[true]{}%
%% show the bounding box for delaunay
-\define@choicekey*{tracePoints}{bbox}[\val\nr]{none, show}{%
+\define@choicekey*{drawPoints}{bbox}[\val\nr]{none, show}{%
\ifcase\nr\relax%
\def\luameshval@tp@bbox{none}%
\or%
\fi%
}%
%% the scale
-\define@key{tracePoints}{scale}[1cm]{\def\luameshval@tp@scale{#1}}%
+\define@key{drawPoints}{scale}[1cm]{\def\luameshval@tp@scale{#1}}%
%% print points
-\define@choicekey*{tracePoints}{print}[\val\nr]{none, points}{%
+\define@choicekey*{drawPoints}{print}[\val\nr]{none, points}{%
\ifcase\nr\relax%
\def\luameshval@tp@print{none}%
\or%
\fi%
}%
%% the name of the point
-\define@key{tracePoints}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}%
+\define@key{drawPoints}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}%
%% the mode for reading the points
-\define@choicekey*{tracePoints}{mode}[\val\nr]{int, ext}{%
+\define@choicekey*{drawPoints}{mode}[\val\nr]{int, ext}{%
\ifcase\nr\relax%
\def\luameshval@tp@mode{int}%
\or%
\fi%
}%
%% the name of the color of drawing
-\define@key{tracePoints}{color}[black]{\def\luameshval@tp@color{#1}}%
+\define@key{drawPoints}{color}[black]{\def\luameshval@tp@color{#1}}%
%% the name of the color of drawing the bbox
-\define@key{tracePoints}{colorBbox}[black]{\def\luameshval@tp@colorbbox{#1}}%
+\define@key{drawPoints}{colorBbox}[black]{\def\luameshval@tp@colorbbox{#1}}%
%
-\presetkeys{tracePoints}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+\presetkeys{drawPoints}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
%
-\newcommand{\tracePointsMesh}[2][]{%
+\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{tracePoints}{#1} %
+ \setkeys{drawPoints}{#1} %
\def\MeshPoint{\luameshval@tp@meshpoint}%
- \ifKV@buildMesh@tikz% if we are using tikz
+ \ifKV@drawPoints@tikz% if we are using tikz
\directlua{%
- % buildMeshTikZ("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","full","\luameshval@tp@scale","\luameshval@tp@color")%
+ printPointsTikZ("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale","\luameshval@tp@color","\luameshval@tp@colorbbox")%
}%
\else % we are using MP
- \mplibcolor{\luameshmpcolor}{\luameshval@tp@color}
- \mplibcolor{\luameshmpcolorBbox}{\luameshval@tp@colorbbox}
+ \mplibcolor{\luameshmpcolor}{\luameshval@tp@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval@tp@colorbbox}%
\directlua{%
printPointsMP("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale")%
}%
}%
%
-%%%%%%%%%%%%%%%% the trace Points macro inc with callbacks
+%%%%%%%%%%%%%%%% the draw Points macro inc with callbacks
%% engine of drawing
-\define@boolkey{tracePointsInc}{tikz}[true]{}%
+\define@boolkey{drawPointsInc}{tikz}[true]{}%
%% show the bounding box for delaunay
-\define@choicekey*{tracePointsInc}{bbox}[\val\nr]{none, show}{%
+\define@choicekey*{drawPointsInc}{bbox}[\val\nr]{none, show}{%
\ifcase\nr\relax%
\def\luameshval@tpi@bbox{none}%
\or%
\fi%
}%
%% the scale
-\define@key{tracePointsInc}{scale}[1cm]{\def\luameshval@tpi@scale{#1}}%
+\define@key{drawPointsInc}{scale}[1cm]{\def\luameshval@tpi@scale{#1}}%
%% print points
-\define@choicekey*{tracePointsInc}{print}[\val\nr]{none, points}{%
+\define@choicekey*{drawPointsInc}{print}[\val\nr]{none, points}{%
\ifcase\nr\relax%
\def\luameshval@tpi@print{none}%
\or%
\fi%
}%
%% the name of the point
-\define@key{tracePointsInc}{meshpoint}[P]{\def\luameshval@tpi@meshpoint{#1}}%
+\define@key{drawPointsInc}{meshpoint}[P]{\def\luameshval@tpi@meshpoint{#1}}%
%% the mode for reading the points
-\define@choicekey*{tracePointsInc}{mode}[\val\nr]{int, ext}{%
+\define@choicekey*{drawPointsInc}{mode}[\val\nr]{int, ext}{%
\ifcase\nr\relax%
\def\luameshval@tpi@mode{int}%
\or%
%
% color
%% the name of the color of drawing
-\define@key{tracePointsInc}{color}[black]{\def\luameshval@tpi@color{#1}}%
+\define@key{drawPointsInc}{color}[black]{\def\luameshval@tpi@color{#1}}%
%% the name of the color of drawing the bbox
-\define@key{tracePointsInc}{colorBbox}[black]{\def\luameshval@tpi@colorbbox{#1}}%
+\define@key{drawPointsInc}{colorBbox}[black]{\def\luameshval@tpi@colorbbox{#1}}%
%
-\presetkeys{tracePointsInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+\presetkeys{drawPointsInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand*{\tracePointsMeshinc}[4][]{%
+\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{tracePointsInc}{#1} %
+ \setkeys{drawPointsInc}{#1} %
\def\MeshPoint{\luameshval@tpi@meshpoint}%
- \ifKV@tracePointsInc@tikz% if we are using tikz
+ \ifKV@drawPointsInc@tikz% if we are using tikz
\directlua{%
- buildMeshTikZ("#2","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","full","\luameshval@tpi@sc%ale","\luameshval@tpi@color")%
+ printPointsTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","\luameshval@tpi@scale","\luameshval@tpi@color","\luameshval@tpi@colorbbox")%
}%
\else % we are using MP
- \mplibcolor{\luameshmpcolor}{\luameshval@tpi@color}
- \mplibcolor{\luameshmpcolorBbox}{\luameshval@tpi@colorbbox}
+ \mplibcolor{\luameshmpcolor}{\luameshval@tpi@color}%
+ \mplibcolor{\luameshmpcolorBbox}{\luameshval@tpi@colorbbox}%
\directlua{%
- printPointsMPinc("#2","#3","#4","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","\luameshval@tpi@scale")%
+ printPointsMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","\luameshval@tpi@scale")%
}%
\fi%
}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% the meshAddOnePointBW commande
-%%engine of drawing
+%%engine of draiwng
\define@boolkey{MeshAddOneBW}{tikz}[true]{}%
%% the scale
\define@key{MeshAddOneBW}{scale}[1cm]{\def\luameshval@ap@scale{#1}}%
% #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{MeshAddOneBW}{#1} %
\def\MeshPoint{\luameshval@ap@meshpoint}%
\def\NewPoint{\luameshval@ap@newpoint}%
- \ifKV@MeshAddOne@tikz% if we are using tikz
+ \ifKV@MeshAddOneBW@tikz% if we are using tikz
\directlua{%
- buildMeshTikZ("#2","\luameshval@ap@mode","\luameshval@ap@print","\luameshval@ap@bbox","full","\luameshval@ap@scale","\luameshval@ap@color")%
+ TeXOnePointTikZBW("#2","#3","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@color","\luameshval@ap@colorback","\luameshval@ap@colornew","\luameshval@ap@colorcircle","\luameshval@ap@colorbbox")%
}%
\else % we are using MP
\mplibcolor{\luameshmpcolor}{\luameshval@ap@color}
\def\NewPoint{\luameshval@api@newpoint}%
\ifKV@MeshAddOneBWinc@tikz% if we are using tikz
\directlua{%
- buildMeshTikZ("#2","\luameshval@api@mode","\luameshval@api@print","\luameshval@api@bbox","\luameshval@api@scale","\luameshval@api@color")%
+ TeXOnePointTikZBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@color","\luameshval@ap@colorback","\luameshval@ap@colornew","\luameshval@ap@colorcircle","\luameshval@ap@colorbbox")%
}%
\else % we are using MP
\mplibcolor{\luameshmpcolor}{\luameshval@api@color}
\mplibcolor{\luameshmpcolorCircle}{\luameshval@api@colorcircle}
\mplibcolor{\luameshmpcolorBbox}{\luameshval@api@colorbbox}
\directlua{%
- TeXOnePointMPBWinc("#2","#3","#4","#5","\luameshval@api@step","\luameshval@api@scale","\luameshval@api@mode","\luameshval@api@bbox")%
+ TeXOnePointMPBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@api@step","\luameshval@api@scale","\luameshval@api@mode","\luameshval@api@bbox")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the drawGmsh command inc
+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define@boolkey{drawGmshInc}{tikz}[true]{}%
+%% the scale
+\define@key{drawGmshInc}{scale}[1cm]{\def\luameshvaldgi@scale{#1}}%
+%% print ponits ?
+\define@choicekey*{drawGmshInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshvaldgi@print{none}%
+ \or%
+ \def\luameshvaldgi@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define@key{drawGmshInc}{meshpoint}[P]{\def\luameshvaldgi@meshpoint{#1}}%
+%% the name of the color of drawing
+\define@key{drawGmshInc}{color}[black]{\def\luameshvaldgi@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@meshpoint}%
+ \ifKV@drawGmshInc@tikz% if we are using tikz
+ \directlua{%
+ drawGmshTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi@print","\luameshvaldgi@scale","\luameshvaldgi@color")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshvaldgi@color}%
+ \directlua{%
+ drawGmshMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi@print","\luameshvaldgi@scale")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the drawGmshBW command
+%% the code is complete and we don't have any callbacks
+\define@boolkey{drawGmsh}{tikz}[true]{}%
+%% the scale
+\define@key{drawGmsh}{scale}[1cm]{\def\luameshvaldg@scale{#1}}%
+%% print points
+\define@choicekey*{drawGmsh}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshvaldg@print{none}%
+ \or%
+ \def\luameshvaldg@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define@key{drawGmsh}{meshpoint}[P]{\def\luameshvaldg@meshpoint{#1}}%
+%% the name of the color of drawing
+\define@key{drawGmsh}{color}[black]{\def\luameshvaldg@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@meshpoint}%
+ \ifKV@drawGmsh@tikz% if we are using tikz
+ \directlua{%
+ drawGmshTikZ("#2","\luameshvaldg@print","\luameshvaldg@scale","\luameshvaldg@color")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshvaldg@color}%
+ \directlua{%
+ drawGmshMP("#2","\luameshvaldg@print","\luameshvaldg@scale")%
+ }%
+ %
+ \fi%
+}%
+%%%%%%%%%%%%%%%% the gmshVoronoi command
+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define@boolkey{gmshVoronoiInc}{tikz}[true]{}%
+%% the scale
+\define@key{gmshVoronoiInc}{scale}[1cm]{\def\luameshval@gvi@scale{#1}}%
+%% print ponits ?
+\define@choicekey*{gmshVoronoiInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gvi@print{none}%
+ \or%
+ \def\luameshval@gvi@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define@key{gmshVoronoiInc}{meshpoint}[P]{\def\luameshval@gvi@meshpoint{#1}}%
+%% the name of the circum point
+\define@key{gmshVoronoiInc}{circumpoint}[P]{\def\luameshval@gvi@circumpoint{#1}}%
+%% the mode for reading the points
+\define@choicekey*{gmshVoronoiInc}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gvi@delaunay{none}%
+ \or%
+ \def\luameshval@gvi@delaunay{show}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define@choicekey*{gmshVoronoiInc}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gvi@styleDelaunay{none}%
+ \or%
+ \def\luameshval@gvi@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define@choicekey*{gmshVoronoiInc}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gvi@styleVoronoi{none}%
+ \or%
+ \def\luameshval@gvi@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define@key{gmshVoronoiInc}{color}[black]{\def\luameshval@gvi@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define@key{gmshVoronoiInc}{colorVoronoi}[red]{\def\luameshval@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@gvi@meshpoint}%
+ \def\CircumPoint{\luameshval@gvi@circumpoint}%
+ \ifKV@gmshVoronoiInc@tikz% if we are using tikz
+ \directlua{%
+ gmshVoronoiTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@color","\luameshval@gvi@colorvoronoi","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval@gvi@color}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@gvi@colorvoronoi}%
+ \directlua{%
+ gmshVoronoiMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the gmshVoronoiBW command
+%% the code is complete and we don't have any callbacks
+\define@boolkey{gmshVoronoi}{tikz}[true]{}%
+%% the scale
+\define@key{gmshVoronoi}{scale}[1cm]{\def\luameshval@gv@scale{#1}}%
+%% print points
+\define@choicekey*{gmshVoronoi}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gv@print{none}%
+ \or%
+ \def\luameshval@gv@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define@key{gmshVoronoi}{meshpoint}[P]{\def\luameshval@gv@meshpoint{#1}}%
+%% the name of the circum point
+\define@key{gmshVoronoi}{circumpoint}[P]{\def\luameshval@gv@circumpoint{#1}}%
+%% the mode for reading the points
+\define@choicekey*{gmshVoronoi}{delaunay}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gv@delaunay{none}%
+ \or%
+ \def\luameshval@gv@delaunay{show}%
+ \fi%
+}%
+%% style dashed Delaunay
+\define@choicekey*{gmshVoronoi}{styleDelaunay}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gv@styleDelaunay{none}%
+ \or%
+ \def\luameshval@gv@styleDelaunay{dashed}%
+ \fi%
+}%
+%% style dashed Voronoi
+\define@choicekey*{gmshVoronoi}{styleVoronoi}[\val\nr]{none, dashed}{%
+ \ifcase\nr\relax%
+ \def\luameshval@gv@styleVoronoi{none}%
+ \or%
+ \def\luameshval@gv@styleVoronoi{dashed}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define@key{gmshVoronoi}{color}[black]{\def\luameshval@gv@color{#1}}%
+%% the name of the color of drawing Voronoi
+\define@key{gmshVoronoi}{colorVoronoi}[red]{\def\luameshval@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@gv@meshpoint}%
+ \def\CircumPoint{\luameshval@gv@circumpoint}%
+ \ifKV@gmshVoronoi@tikz% if we are using tikz
+ \directlua{%
+ gmshVoronoiTikZ("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@color","\luameshval@gv@colorVoronoi","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi")%
+ }%
+ \else % we are using MP
+ \mplibcolor{\luameshmpcolor}{\luameshval@gv@color}%
+ \mplibcolor{\luameshmpcolorVoronoi}{\luameshval@gv@colorVoronoi}%
+ \directlua{%
+ gmshVoronoiMP("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi")%
}%
%
\fi%
}%
-%
\ No newline at end of file