X-Git-Url: https://melusine.eu.org/syracuse/G/git/?a=blobdiff_plain;f=luamesh.lua;h=945d9cc443c9eafc02b439815e374011eeb895a5;hb=776ad3dd0098ae161c45a2973036f0c435389920;hp=f165fe69389ca404a6720e4226d78913b402c285;hpb=99c7eb1c5fdd23d7617d3817806af416e4614d15;p=delaunay.git diff --git a/luamesh.lua b/luamesh.lua index f165fe6..945d9cc 100644 --- a/luamesh.lua +++ b/luamesh.lua @@ -449,11 +449,11 @@ function TeXaddOnePointTikZ(chaine,point,step,color,colorBack, colorNew, colorCi return output end -function TeXaddOnePointMP(listPoints,P,step,color,colorBack, colorNew, colorCircle) +function TeXaddOnePointMP(listPoints,P,step,color,colorBack, colorNew, colorCircle,bbox) output = ""; output = output .. "pair MeshPoints[];" -- build the triangulation - triangulation = BowyerWatson(listPoints,"none") + triangulation = BowyerWatson(listPoints,bbox) badTriangles = buildBadTriangles(P,triangulation) for i=1,#listPoints do output = output .. "MeshPoints[".. i .. "] = (" .. listPoints[i].x .. "," .. listPoints[i].y .. ");" @@ -570,13 +570,13 @@ function buildListExt(chaine, stop) end -function TeXFullOnePointTikZ(chaine,point,step,color,colorBack,colorNew,colorCircle,scale) +function TeXOnePointTikZ(chaine,point,step,color,colorBack,colorNew,colorCircle,scale) output = TeXaddOnePointTikZ(chaine,point,step,color,colorBack,colorNew,colorCircle) output = "\\noindent\\begin{tikzpicture}[x="..scale..",y="..scale.."]".. output .. "\\end{tikzpicture}" tex.sprint(output) end -function TeXFullOnePointMP(chaine,point,step,color,colorBack,colorNew,colorCircle,scale,mode) +function TeXOnePointMP(chaine,point,step,color,colorBack,colorNew,colorCircle,scale,mode,picture,bbox) if(mode=="int") then Sx,Sy=string.match(point,"%((.+),(.+)%)") P = {x=Sx, y=Sy} @@ -585,7 +585,11 @@ function TeXFullOnePointMP(chaine,point,step,color,colorBack,colorNew,colorCircl -- point is a number P, listPoints = buildListExt(chaine,tonumber(point)) end - output = TeXaddOnePointMP(listPoints,P,step,color,colorBack,colorNew,colorCircle) - output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale..";".. output .. "endfig;\\end{mplibcode}" + output = TeXaddOnePointMP(listPoints,P,step,color,colorBack,colorNew,colorCircle,bbox) + if(picture=="full") then + output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale..";".. output .. "endfig;\\end{mplibcode}" + else + output = "u:="..scale..";".. output + end tex.sprint(output) end