From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/60725 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: metapost and lua Date: Fri, 6 Aug 2010 00:32:19 +0200 Message-ID: <20100805223218.GA13680@aides> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0884560884==" X-Trace: dough.gmane.org 1281047534 10774 80.91.229.12 (5 Aug 2010 22:32:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Aug 2010 22:32:14 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 06 00:32:12 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oh8yx-0002v1-RQ for gctc-ntg-context-518@m.gmane.org; Fri, 06 Aug 2010 00:32:11 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 283F0CA060; Fri, 6 Aug 2010 00:32:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AjR3cXz6aENJ; Fri, 6 Aug 2010 00:32:08 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 33521CA05B; Fri, 6 Aug 2010 00:32:08 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B181ECA05B for ; Fri, 6 Aug 2010 00:32:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xaq+jveHPYUb for ; Fri, 6 Aug 2010 00:32:04 +0200 (CEST) Original-Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by balder.ntg.nl (Postfix) with ESMTP id EA054CA052 for ; Fri, 6 Aug 2010 00:32:03 +0200 (CEST) Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o75MVtNW005608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 6 Aug 2010 00:31:56 +0200 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o75MW2dg027816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 6 Aug 2010 00:32:02 +0200 Original-Received: from localhost (mnhm-4d011240.pool.mediaWays.net [77.1.18.64]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id o75MVwww014622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 6 Aug 2010 00:31:58 +0200 X-Operating-System: Linux aides 2.6.34-rc3 X-Polite-Request: "Please try to be nice, don't send html mail." User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:60725 Archived-At: --===============0884560884== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all! [1] Is there a Lua interface for metapost? I'm thinking of something like cld is for TeX here. All I figured out so far is how to generate mp code (as strings) in Lua and then having it processed by mplib, but as the metafun manual is from 2002 and with context you never know how far it is ahead of your dreams =E2= =80=A6 [1a] If not [1], then: will there ever be something like this? [2] There's an example for =E2=80=9Cmetapost.process()=E2=80=9D in mlib= -ctx.mkiv but I can't get it to work. I simply copypasted it as follows: =C2=B7=C2=B7=C2=B78<=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7 \starttext \startluacode mpgraphic =3D [[ for i=3D1 upto 1000 : beginfig(0); draw halfcircle scaled 1cm withcolor green ; picture p ; p :=3D "oeps" infont defaultfont scaled .75 rotated= 45 ; p :=3D p shifted - (xpart center p,0) ; draw p ; draw boundingbox p ; endfig ; beginfig(0); draw halfcircle scaled 1cm dashed evenly withcolor green ; endfig ; beginfig(0); pickup pencircle xscaled .5mm yscaled .25mm rotated 45 ; draw halfcircle scaled 1cm withcolor red ; endfig ; beginfig(0); draw halfcircle scaled 1cm ; endfig ; beginfig(0); pickup pencircle xscaled .5mm yscaled .25mm rotated 45 ; for k:=3D1 upto 10 : draw halfcircle scaled uniformdeviate(1cm) withcolor (red/(= k/4)) ; endfor ; endfig ; = =20 endfor ; ]] metapost.process(metapost.format("metafun"),mpgraphic) \stopluacode \stoptext =C2=B7=C2=B7=C2=B78<=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7 This fails in mlib-run.lua at line 324. (Same with all my other tries, but I assume code from the context sources has a much higher probability of being valid.) Do I miss something critical? Thanks for your help, Philipp --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkxbO/IACgkQ02lYlJYWs9ItOgCfRFGk/Cl1AtGWmYcBm48ngTt7 aMkAoKZUy6atrvhkzof7JhZTQEs4DO6r =Kh4W -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4-- --===============0884560884== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0884560884==--