Fonction pour tracer seulement les points du maillage
[delaunay.git] / luamesh.lua
index 060d389..5227f86 100644 (file)
@@ -301,6 +301,34 @@ function traceMeshMP(listPoints, triangulation,points)
 end
 
 
+-- print points of the mesh
+function tracePointsMP(listPoints,points)
+   output = "";
+   output = output .. " pair MeshPoints[];"
+   for i=1,#listPoints do
+      output = output .. "MeshPoints[".. i .. "] = (" .. listPoints[i].x .. "," .. listPoints[i].y .. ");"
+   end
+   if(points=="points") then
+      for i=1,#listPoints do
+         if(listPoints[i].type == "bbox") then
+            output = output .. "dotlabel.llft (btex $\\MeshPoint_{" .. i .. "}$ etex, (" .. listPoints[i].x ..",".. listPoints[i].y .. ")*u ) withcolor \\luameshmpcolorBbox ;"
+         else
+            output = output .. "dotlabel.llft (btex $\\MeshPoint_{" .. i .. "}$ etex, (" .. listPoints[i].x ..",".. listPoints[i].y .. ")*u ) withcolor \\luameshmpcolor ;"
+         end
+      end
+   else
+      for i=1,#listPoints do
+         if(listPoints[i].type == "bbox") then
+            output = output .. "drawdot  (" .. listPoints[i].x ..",".. listPoints[i].y .. ")*u ) withcolor \\luameshmpcolorBbox ;"
+         else
+            output = output .. "drawdot (" .. listPoints[i].x ..",".. listPoints[i].y .. ")*u ) withcolor \\luameshmpcolor ;"
+         end
+      end
+   end
+   return output
+end
+
+
 
 -- buildMesh with TikZ
 function buildMeshTikZ(chaine,mode,points,bbox,full,scale,color)
@@ -323,6 +351,29 @@ function buildMeshMPBW(chaine,mode,points,bbox,scale)
    tex.sprint(output)
 end
 
+-- print points to mesh
+function printPointsMP(chaine,mode,points,bbox,scale)
+   listPoints = buildList(chaine, mode)
+   if(bbox == "bbox" ) then
+      listPoints = buildBoundingBox(listPoints)
+   end
+   output = tracePointsMP(listPoints,points)
+   output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
+   tex.sprint(output)
+end
+
+
+-- print points to mesh
+function printPointsMPinc(chaine,beginning, ending, mode,points,bbox,scale)
+   listPoints = buildList(chaine, mode)
+   if(bbox == "bbox" ) then
+      listPoints = buildBoundingBox(listPoints)
+   end
+   output = tracePointsMP(listPoints,points)
+   output = "\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+   tex.sprint(output)
+end
+
 
 -- buildMesh with MP include code
 function buildMeshMPBWinc(chaine,beginning, ending,mode,points,bbox,scale)

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.