X-Git-Url: https://melusine.eu.org/syracuse/G/git/?p=delaunay.git;a=blobdiff_plain;f=luamesh.sty;h=b0ee1fc176271f77b667355244cf7b932df85a3e;hp=c0a1789a0adaeb51ca2bcb3c614805f5e24e1b72;hb=fc5d330713640fd0b5ad351db12b7c4e3143fca6;hpb=8b4d19195c3a5346157172be57d3ac7c5b756220 diff --git a/luamesh.sty b/luamesh.sty index c0a1789..b0ee1fc 100644 --- a/luamesh.sty +++ b/luamesh.sty @@ -856,6 +856,14 @@ \def\luameshval@mp@mode{ext}% \fi% }% +%% the mode for the generation of gridpoints +\define@choicekey*{meshPolygon}{gridpoints}[\val\nr]{rect, perturb}{% + \ifcase\nr\relax% + \def\luameshval@mp@gridpoints{rect}% + \or% + \def\luameshval@mp@gridpoints{perturb}% + \fi% +}% %% the different steps of the meshing \define@choicekey*{meshPolygon}{step}[\val\nr]{polygon, grid, points, mesh}{% \ifcase\nr\relax% @@ -875,7 +883,7 @@ \define@key{meshPolygon}{colorPolygon}[red]{\def\luameshval@mp@colorPolygon{#1}}% %% the name of the color of drawing the bbox % -\presetkeys{meshPolygon}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint}{}% +\presetkeys{meshPolygon}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect}{}% % \newcommand{\meshPolygon}[2][]{% % #1 : optionnal arguments @@ -885,13 +893,13 @@ \def\MeshPoint{\luameshval@mp@meshpoint}% \ifKV@meshPolygon@tikz% if we are using tikz \directlua{% - drawMeshPolygonTikZ("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@color","\luameshval@mp@colorPolygon")% + drawMeshPolygonTikZ("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@color","\luameshval@mp@colorPolygon","\luameshval@mp@gridpoints")% }% \else % we are using MP \mplibcolor{\luameshmpcolor}{\luameshval@mp@color}% \mplibcolor{\luameshmpcolorPoly}{\luameshval@mp@colorPolygon}% \directlua{% - drawMeshPolygonMP("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale")% + drawMeshPolygonMP("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@gridpoints")% }% % \fi% @@ -912,6 +920,14 @@ \def\luameshval@mpi@print{dotpoints}% \fi% }% +%% the mode for the generation of gridpoints +\define@choicekey*{meshPolygonInc}{gridpoints}[\val\nr]{rect, perturb}{% + \ifcase\nr\relax% + \def\luameshval@mpi@gridpoints{rect}% + \or% + \def\luameshval@mpi@gridpoints{perturb}% + \fi% +}% %% the name of the point \define@key{meshPolygonInc}{meshpoint}[P]{\def\luameshval@mpi@meshpoint{#1}}% %% the grid parameter @@ -943,7 +959,7 @@ \define@key{meshPolygonInc}{colorPolygon}[red]{\def\luameshval@mpi@colorPolygon{#1}}% %% the name of the color of drawing the bbox % -\presetkeys{meshPolygonInc}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint}{}% +\presetkeys{meshPolygonInc}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect}{}% % \newcommand{\meshPolygonInc}[4][]{% % #1 : optionnal arguments @@ -955,13 +971,13 @@ \def\MeshPoint{\luameshval@mpi@meshpoint}% \ifKV@meshPolygonInc@tikz% if we are using tikz \directlua{% - drawMeshPolygonTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@color","\luameshval@mpi@colorPolygon")% + drawMeshPolygonTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@color","\luameshval@mpi@colorPolygon","\luameshval@mpi@gridpoints")% }% \else % we are using MP \mplibcolor{\luameshmpcolor}{\luameshval@mpi@color}% \mplibcolor{\luameshmpcolorPoly}{\luameshval@mpi@colorPolygon}% \directlua{% - drawMeshPolygonMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale")% + drawMeshPolygonMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@gridpoints")% }% % \fi%