X-Git-Url: https://melusine.eu.org/syracuse/G/git/?a=blobdiff_plain;f=luamesh.sty;h=ccb1863f0910dbf57eb9abb87a7b54104be39def;hb=879d59ce1be390214fb7c0364c44c3fc1acff916;hp=82e32149f5dc95813b7b4a98485e30fca6b97c66;hpb=4b4f6ae2ce34662269e37912c19c856ebf0cde17;p=delaunay.git diff --git a/luamesh.sty b/luamesh.sty index 82e3214..ccb1863 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,131 @@ \fi% }% % +%%%%%%%%%%%%%%%%% the trace Points macro +%% engine of drawing +\newif\ifluameshengineMP% +\define@boolkey{tracePoints}{tikz}[true]{}% +%% show the bounding box for delaunay +\define@choicekey*{tracePoints}{bbox}[\val\nr]{none, show}{% + \ifcase\nr\relax% + \def\luameshval@tp@bbox{none}% + \or% + \def\luameshval@tp@bbox{bbox}% + \fi% +}% +%% the scale +\define@key{tracePoints}{scale}[1cm]{\def\luameshval@tp@scale{#1}}% +%% print points +\define@choicekey*{tracePoints}{print}[\val\nr]{none, points}{% + \ifcase\nr\relax% + \def\luameshval@tp@print{none}% + \or% + \def\luameshval@tp@print{points}% + \fi% +}% +%% the name of the point +\define@key{tracePoints}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}% +%% the mode for reading the points +\define@choicekey*{tracePoints}{mode}[\val\nr]{int, ext}{% + \ifcase\nr\relax% + \def\luameshval@tp@mode{int}% + \or% + \def\luameshval@tp@mode{ext}% + \fi% +}% +% +% color +%% the name of the color of drawing +\define@key{tracePoints}{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}}% +% +\presetkeys{tracePoints}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}% +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% the difinition BW Bowyer and Watson algo +\newcommand{\tracePointsMesh}[2][]{% + % #1 : the string containing the list of points + % (x1,y1);(x2,y2);... or the name file containing the points + \setkeys{tracePoints}{#1} % + \def\MeshPoint{\luameshval@tp@meshpoint}% + \ifKV@buildMesh@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")% + }% + \else % we are using MP + \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")% + }% + % + \fi% +}% +% + +%%%%%%%%%%%%%%%% the trace Points macro inc +%% engine of drawing +\newif\ifluameshengineMP% +\define@boolkey{tracePointsInc}{tikz}[true]{}% +%% show the bounding box for delaunay +\define@choicekey*{tracePointsInc}{bbox}[\val\nr]{none, show}{% + \ifcase\nr\relax% + \def\luameshval@tp@bbox{none}% + \or% + \def\luameshval@tp@bbox{bbox}% + \fi% +}% +%% the scale +\define@key{tracePointsInc}{scale}[1cm]{\def\luameshval@tp@scale{#1}}% +%% print points +\define@choicekey*{tracePointsInc}{print}[\val\nr]{none, points}{% + \ifcase\nr\relax% + \def\luameshval@tp@print{none}% + \or% + \def\luameshval@tp@print{points}% + \fi% +}% +%% the name of the point +\define@key{tracePointsInc}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}% +%% the mode for reading the points +\define@choicekey*{tracePointsInc}{mode}[\val\nr]{int, ext}{% + \ifcase\nr\relax% + \def\luameshval@tp@mode{int}% + \or% + \def\luameshval@tp@mode{ext}% + \fi% +}% +% +% color +%% the name of the color of drawing +\define@key{tracePointsInc}{color}[black]{\def\luameshval@tp@color{#1}}% +%% the name of the color of drawing the bbox +\define@key{tracePointsInc}{colorBbox}[black]{\def\luameshval@tp@colorbbox{#1}}% +% +\presetkeys{tracePointsInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}% +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% the difinition BW Bowyer and Watson algo +\newcommand*{\tracePointsMeshinc}[4][]{% + % #1 : the string containing the list of points + % (x1,y1);(x2,y2);... or the name file containing the points + \setkeys{tracePointsInc}{#1} % + \def\MeshPoint{\luameshval@tp@meshpoint}% + \ifKV@tracePointsInc@tikz% if we are using tikz + \directlua{% + buildMeshTikZ("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","full","\luameshval@tp@sc%ale","\luameshval@tp@color")% + }% + \else % we are using MP + \mplibcolor{\luameshmpcolor}{\luameshval@tp@color} + \mplibcolor{\luameshmpcolorBbox}{\luameshval@tp@colorbbox} + \directlua{% + printPointsMPinc("#2","#3","#4","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale")% + }% + \fi% +}% +% +% %% % %%the meshAddOnePointBW commande