From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82357 Path: news.gmane.org!not-for-mail From: Roland Thiers Newsgroups: gmane.comp.tex.context Subject: command for a MP graphic Date: Tue, 7 May 2013 09:30:35 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1367911863 24540 80.91.229.3 (7 May 2013 07:31:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 May 2013 07:31:03 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 07 09:31:03 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UZcMV-0004yn-F8 for gctc-ntg-context-518@m.gmane.org; Tue, 07 May 2013 09:30:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C66E4101E9; Tue, 7 May 2013 09:30:58 +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 2GPPTCQCCI2h; Tue, 7 May 2013 09:30:56 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id AA44E101E4; Tue, 7 May 2013 09:30:56 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 54D26101E4 for ; Tue, 7 May 2013 09:30:55 +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 1lZCySHBJovm for ; Tue, 7 May 2013 09:30:54 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 5AE1B101E0 for ; Tue, 7 May 2013 09:30:44 +0200 (CEST) Original-Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r477UhZv009998 for ; Tue, 7 May 2013 09:30:43 +0200 Original-Received: by mail-wi0-f177.google.com with SMTP id hq12so262074wib.10 for ; Tue, 07 May 2013 00:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:from:to:content-type :content-transfer-encoding:mime-version:subject:date:x-mailer; bh=6Kv5n+EpWKBEei5L2kVjcI8pvQVLTFcg2Vy0SwzBr0w=; b=iwfvvGx230FJ/nbHWzomCEyn2k7wfOJ6s2Qx5uQXj/idgcHGCjXtGp3pzOulZztPOz WwTwGGfxBEOwTy5e3Es7ZtoOnsSeRDwi2dWD3sPIV+giSIMnJWi8vhqOX1nVoCmVoUhD WeS6P6Igk54wGbID4uWU13+VaMdd8CjKxKfqbgGNGc6Rt95vV4dT1M5tNpGCsFwVrwTg 0DJvJjazyfxFvPdbBUrhVqHew7PFl0k3YNY6HdBr+FkrgfLxcY04VVB3o44p6iWz0Zue m7L33KmaHafFP5/bIvGGRB2oDyOL2lWAmNRpogoQ+si7f2zOOeN2omdpPZX8fe+JXQFF T0BQ== X-Received: by 10.194.176.164 with SMTP id cj4mr1066652wjc.58.1367911838827; Tue, 07 May 2013 00:30:38 -0700 (PDT) Original-Received: from ?IPv6:2a01:e34:ef6d:4c40:223:12ff:fe08:c8eb? ([2a01:e34:ef6d:4c40:223:12ff:fe08:c8eb]) by mx.google.com with ESMTPSA id g8sm1018252wiy.4.2013.05.07.00.30.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 May 2013 00:30:37 -0700 (PDT) X-Mailer: Apple Mail (2.936) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::231; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06JwTuHSz - 8fb0f1e2ca1f - 20130507 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:82357 Archived-At: Hi, I did this code to get a regular polygon with metafun, it works but I would like to have an user command like \define or \def to be able to choose the number of sides, n. I don't know how to do that ... \startbuffer[largeurdeslignes] drawoptions (withpen pencircle scaled 2pt); \stopbuffer \startbuffer[polygoneregulier] numeric u ; u:=1*cm ; numeric n ; n:=7 ; pair a[]; a[0]:=(0,3u); path polygone[] ; for i=1 upto n : a[i]:=a[0] rotatedaround(origin,i*360/n) ; polygone[i]:=a[i-1]--a[i]; draw polygone[i]; endfor; \stopbuffer \startbuffer[cercleunite] draw fullcircle scaled 6u withcolor blue; \stopbuffer \define \polyreg {\processMPbuffer[largeurdeslignes,polygoneregulier,cercleunite]} \starttext \polyreg \stoptext Thanks, Roland Thiers ___________________________________________________________________________________ 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 ___________________________________________________________________________________