+%% the user can write code (tikz or MP)
+%% before and after the generated code
+\define@boolkey{buildMeshInc}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define@choicekey*{buildMeshInc}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bmi@bbox{none}%
+ \or%
+ \def\luameshval@bmi@bbox{bbox}%
+ \fi%
+}%
+%% the scale
+\define@key{buildMeshInc}{scale}[1cm]{\def\luameshval@bmi@scale{#1}}%
+%% print ponits ?
+\define@choicekey*{buildMeshInc}{print}[\val\nr]{none, points}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bmi@print{none}%
+ \or%
+ \def\luameshval@bmi@print{points}%
+ \fi%
+}%
+%% the name of the point
+\define@key{buildMeshInc}{meshpoint}[P]{\def\luameshval@bmi@meshpoint{#1}}%
+%% the mode for reading the points
+\define@choicekey*{buildMeshInc}{mode}[\val\nr]{int, ext}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bmi@mode{int}%
+ \or%
+ \def\luameshval@bmi@mode{ext}%
+ \fi%
+}%
+%% the name of the color of drawing
+\define@key{buildMeshInc}{color}[black]{\def\luameshval@bmi@color{#1}}%
+%% the name of the color of drawing the bbox
+\define@key{buildMeshInc}{colorBbox}[black]{\def\luameshval@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@bmi@meshpoint}%
+ \ifKV@buildMeshInc@tikz% if we are using tikz
+ \directlua{%
+ 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}
+ \directlua{%
+ buildMeshMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale")%
+ }%
+ %
+ \fi%
+}%
+%
+%%%%%%%%%%%%%%%% the buildMeshBW command
+%% the code is complete and we don't have any callbacks