From 847821faaecf92833f1e1564e1ef9377758d4d45 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Mon, 2 Jul 2018 16:09:16 +0200 Subject: 2018-07-02 14:46:00 --- metapost/context/base/mpiv/mp-luas.mpiv | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'metapost') diff --git a/metapost/context/base/mpiv/mp-luas.mpiv b/metapost/context/base/mpiv/mp-luas.mpiv index d025848ca..bebe4c0ad 100644 --- a/metapost/context/base/mpiv/mp-luas.mpiv +++ b/metapost/context/base/mpiv/mp-luas.mpiv @@ -171,6 +171,28 @@ vardef positionatanchor(expr name) = currentpicture := currentpicture shifted - positionxy(name) ; enddef ; - vardef texvar(expr name) = lua.mp.texvar(name) enddef ; vardef texstr(expr name) = lua.mp.texstr(name) enddef ; + +%D New experimental feature for Alan-The-Number-Cruncher: + +% \startMPcode{doublefun} +% path p ; p := ( +% for i=1 upto 20000 : +% origin randomized 10000 .. +% endfor cycle +% ) xysized (TextWidth,TextHeight) ; +% draw for i inpath p: +% pointof i .. controls (leftof i) and (rightof i) .. +% endfor cycle ; +% \stopMPcode + +def inpath suffix p = + = 1 step 1 until lua.mp.mfun_path_length(str p) +enddef ; + +vardef pointof primary i = lua.mp.mfun_path_point(i) enddef ; +vardef leftof primary i = lua.mp.mfun_path_left (i) enddef ; +vardef rightof primary i = lua.mp.mfun_path_right(i) enddef ; + +extra_endfig := extra_endfig & " lua.mp.mfun_path_reset() ; " ; -- cgit v1.2.3