X-Git-Url: https://melusine.eu.org/syracuse/G/git/?a=blobdiff_plain;f=luamesh.sty;h=ae3db837d60090c1a19b9d986ae27a78d1364bcf;hb=e3ebed16be8d70d7ba4b4c7211ff8a5b1d434547;hp=7133ddb537da9bc111b36e8205e3fc70004fbffb;hpb=f86b1ec82bbbba1a96989bb5d6f5b78e261659a1;p=delaunay.git diff --git a/luamesh.sty b/luamesh.sty index 7133ddb..ae3db83 100644 --- a/luamesh.sty +++ b/luamesh.sty @@ -11,7 +11,7 @@ %\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% @@ -21,7 +21,7 @@ %\fi% % % load the lua code -\directlua{dofile("luamesh.lua")}% +\directlua{require("luamesh.lua")}% % %% % for tikz (default value) @@ -33,8 +33,8 @@ \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 user can write code (tikz or MP) %% before and after the generated code @@ -87,8 +87,8 @@ 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","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale")% }% @@ -145,8 +145,8 @@ 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")% }% @@ -155,12 +155,12 @@ }% % % -%%%%%%%%%%%%%%%%% the trace Points macro +%%%%%%%%%%%%%%%%% 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% @@ -168,9 +168,9 @@ \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% @@ -178,9 +178,9 @@ \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% @@ -188,25 +188,25 @@ \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@tracePoints@tikz% if we are using tikz + \ifKV@drawPoints@tikz% if we are using tikz \directlua{% 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")% }% @@ -215,11 +215,11 @@ }% % -%%%%%%%%%%%%%%%% 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% @@ -227,9 +227,9 @@ \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% @@ -237,9 +237,9 @@ \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% @@ -249,28 +249,28 @@ % % 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","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","\luameshval@tpi@scale")% }% @@ -279,7 +279,7 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 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}}%