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 .. ");"
tex.sprint(output)
end
-function TeXOnePointMP(chaine,point,step,color,colorBack,colorNew,colorCircle,scale,mode,picture)
+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}
-- point is a number
P, listPoints = buildListExt(chaine,tonumber(point))
end
- output = TeXaddOnePointMP(listPoints,P,step,color,colorBack,colorNew,colorCircle)
+ 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
\def\luameshval@picture{embedded}%
\fi%
}%
-\presetkeys{MeshAddOne}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,picture=full}{}%
+\define@choicekey*{MeshAddOne}{bbox}[\val\nr]{none, show}{%
+ \ifcase\nr\relax%
+ \def\luameshval@bbox{none}%
+ \or%
+ \def\luameshval@bbox{bbox}%
+ \fi%
+}%
+\presetkeys{MeshAddOne}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,picture=full,bbox=none}{}%
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the difinition
}%
\else % we are using MP
\directlua{%
- TeXOnePointMP("#2","#3","\luameshval@step","\luameshval@color","\luameshval@colorback","\luameshval@colornew","\luameshval@colorcircle","\luameshval@scale","\luameshval@mode","\luameshval@picture")%
+ TeXOnePointMP("#2","#3","\luameshval@step","\luameshval@color","\luameshval@colorback","\luameshval@colornew","\luameshval@colorcircle","\luameshval@scale","\luameshval@mode","\luameshval@picture","\luameshval@bbox")%
}%
%
\fi%