X-Git-Url: https://melusine.eu.org/syracuse/G/git/?p=delaunay.git;a=blobdiff_plain;f=luamesh.sty;h=081cf5a72eb722ff9fedfeadbb1d3290abfcf44d;hp=82e32149f5dc95813b7b4a98485e30fca6b97c66;hb=d865bd5b172801559649eabbef29fd8f3898ce70;hpb=4b4f6ae2ce34662269e37912c19c856ebf0cde17 diff --git a/luamesh.sty b/luamesh.sty index 82e3214..081cf5a 100644 --- a/luamesh.sty +++ b/luamesh.sty @@ -38,6 +38,68 @@ %%%%%%%%%%%%%%%% the buildMesh command %% engine of drawing \newif\ifluameshengineMP% +\define@boolkey{buildMeshInc}{tikz}[true]{}% +%% show the bounding box for delaunay +\define@choicekey*{buildMeshInc}{bbox}[\val\nr]{none, show}{% + \ifcase\nr\relax% + \def\luameshval@bm@bbox{none}% + \or% + \def\luameshval@bm@bbox{bbox}% + \fi% +}% +%% the scale +\define@key{buildMeshInc}{scale}[1cm]{\def\luameshval@bm@scale{#1}}% +%% print ponits ? +\define@choicekey*{buildMeshInc}{print}[\val\nr]{none, points}{% + \ifcase\nr\relax% + \def\luameshval@bm@print{none}% + \or% + \def\luameshval@bm@print{points}% + \fi% +}% +%% the name of the point +\define@key{buildMeshInc}{meshpoint}[P]{\def\luameshval@bm@meshpoint{#1}}% +%% the mode for reading the points +\define@choicekey*{buildMeshInc}{mode}[\val\nr]{int, ext}{% + \ifcase\nr\relax% + \def\luameshval@bm@mode{int}% + \or% + \def\luameshval@bm@mode{ext}% + \fi% +}% +% +%color +%% the name of the color of drawing +\define@key{buildMeshInc}{color}[black]{\def\luameshval@bm@color{#1}}% +%% the name of the color of drawing the bbox +\define@key{buildMeshInc}{colorBbox}[black]{\def\luameshval@bm@colorbbox{#1}}% +% +\presetkeys{buildMeshInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}% +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% the difinition BW Bowyer and Watson algo +\newcommand*{\buildMeshBWinc}[4][]{% + % #1 : the string containing the list of points + % (x1,y1);(x2,y2);... or the name file containing the points + \setkeys{buildMesh}{#1} % + \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")% + }% + \else % we are using MP + \mplibcolor{\luameshmpcolor}{\luameshval@bm@color} + \mplibcolor{\luameshmpcolorBbox}{\luameshval@bm@colorbbox} + \directlua{% + buildMeshMPBWinc("#2","#3","#4","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale")% + }% + % + \fi% +}% +% +%%%%%%%%%%%%%%%% the buildMeshBW command +%% engine of drawing +\newif\ifluameshengineMP% \define@boolkey{buildMesh}{tikz}[true]{}% %% show the bounding box for delaunay \define@choicekey*{buildMesh}{bbox}[\val\nr]{none, show}{% @@ -49,7 +111,7 @@ }% %% the scale \define@key{buildMesh}{scale}[1cm]{\def\luameshval@bm@scale{#1}}% -%% print ponits ? +%% print points \define@choicekey*{buildMesh}{print}[\val\nr]{none, points}{% \ifcase\nr\relax% \def\luameshval@bm@print{none}% @@ -68,7 +130,7 @@ \fi% }% % -%color +% color %% the name of the color of drawing \define@key{buildMesh}{color}[black]{\def\luameshval@bm@color{#1}}% %% the name of the color of drawing the bbox @@ -97,6 +159,8 @@ \fi% }% % +% +% %% % %%the meshAddOnePointBW commande