4 Jan
2015
4 Jan
'15
12:43 a.m.
I seek how to use context-lua to draw a path from ‘points’ in an external file. Below is one way to plot points from an external file, call the file DATA with contents: 1 3 -2 2 -3 -1 3 -2 \starttext \startluacode local metafun = context.metafun metafun.start() io.input(“DATA") while true do local x, y = io.read("*n", "*n") if not x then break end metafun("filldraw fullcircle scaled 2mm shifted(%dcm,%dcm);",x,y) end metafun.stop() \stopluacode \stoptext How to make this a polygon? I know other ways to read and manipulate DATA with Lua—it is the drawing part where I most look for help. Thanks, John