ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: A dumb question about MetaFun
Date: Sun, 16 Aug 2020 22:36:22 +0200	[thread overview]
Message-ID: <2CF72D14-11D6-4550-AC84-E43461C763E4@elvenkind.com> (raw)
In-Reply-To: <b7e24dbe-f4c6-30cb-92bf-08aab13f6960@gmail.com>



> On 16 Aug 2020, at 21:09, Keith McKay <mckaymeister@gmail.com> wrote:
> 
> Jairo
> 
> Try
> 
> draw unitsquare scaled 1cm shifted (xcm, ycm);
> 
> Page 11 of the manual metafun-p.pdf is your friend here. My recent conversation with Taco on this list will be usefull as well.

Also:

\starttext
\startMPpage
% puts the center of the bbox of path p at the point t
primarydef p centered t =
 hide(xshift := xpart t - (xpart urcorner p + xpart llcorner p)/2 ;
      yshift := ypart t - (ypart urcorner p + ypart llcorner p)/2 ; )
 p shifted (xshift,yshift)
enddef;

draw fullsquare scaled 2cm shifted (50,3) centered (100,100);

% just for reference:
drawdot origin withpen pencircle scaled 10 withcolor red;
drawdot (100,100) withpen pencircle scaled 10 withcolor green;
\stopMPpage
\stoptext

(I thought there was a metafun definition for that but I cannot find it).

Best wishes,
Taco
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-08-16 20:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 17:06 Jairo A. del Rio
2020-08-16 19:09 ` Keith McKay
2020-08-16 20:36   ` Taco Hoekwater [this message]
2020-08-16 21:31     ` Jairo A. del Rio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2CF72D14-11D6-4550-AC84-E43461C763E4@elvenkind.com \
    --to=taco@elvenkind.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).