diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-06 21:58:15 +0000 |
commit | 974640d66e61e81cb197ad96fdff7b08343e4c5a (patch) | |
tree | 2e1f75f32f312b7f24ba82b4590ae230bcd6f399 /Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua | |
parent | b4fa72e61230aca75f7f6fbf988821f71edfb6b2 (diff) |
context
git-svn-id: svn://tug.org/texlive/trunk@58167 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua deleted file mode 100644 index 9137861a58e..00000000000 --- a/Master/texmf-dist/tex/context/base/mkiv/mlib-lmt.lua +++ /dev/null @@ -1,63 +0,0 @@ -if not modules then modules = { } end modules ['mlib-lmt'] = { - version = 1.001, - comment = "companion to mlib-ctx.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files", -} - -local mppath = mp.path - -local scannumeric = mp.scan.numeric -local scanpath = mp.scan.path - -local getparameter = metapost.getparameter - -function mp.lmt_function_x(xmin,xmax,xstep,code,shape) -- experimental - local code = "return function(x) return " .. code .. " end" - local action = load(code) - local points = { } - local nofpoints = 0 - if action then - action = action() - end - if shape == "steps" then - local halfx = xstep / 2 - local lastx = xmin - local lasty = action(xmin) - for xi = xmin, xmax, xstep do - local yi = action(xi) - local xx = lastx + halfx - nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, lasty } - nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, yi } - lastx = xi - lasty = yi - end - if points[nofpoints][1] ~= xmax then - local yi = action(xmax) - local xx = lastx + halfx - nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, lasty } - nofpoints = nofpoints + 1 ; points[nofpoints] = { xx, yi } - lastx = xi - lasty = yi - end - else - for xi = xmin, xmax, xstep do - nofpoints = nofpoints + 1 ; points[nofpoints] = { xi, action(xi) } - end - if points[nofpoints][1] ~= xmax then - nofpoints = nofpoints + 1 ; points[nofpoints] = { xmax, action(xmax) } - end - end - mppath(points,shape == "curve" and ".." or "--",false) -end - -function mp.lmt_mesh_set() - local mesh = getparameter { "mesh", "paths" } - structures.references.currentset.mesh = mesh -end - -function mp.lmt_mesh_update() - local mesh = getparameter { "paths" } or getparameter { "mesh", "paths" } - mesh[scannumeric()] = scanpath(true) -end |